MCPcopy Index your code
hub / github.com/processing/p5.js / mult

Method mult

src/math/p5.Vector.js:981–996  ·  view source on GitHub ↗

* @param {p5.Vector} v vector to multiply with the components of the original vector. * @chainable

(args)

Source from the content-addressed store, hash-verified

979 * @chainable
980 */
981 mult(args) {
982 const minDimension = prioritizeSmallerDimension(this.dimensions, args);
983 shrinkToDimension(this.values, minDimension);
984
985 if(Array.isArray(args)){
986 for (let i = 0; i < this.values.length; i++) {
987 this.values[i] *= args[i];
988 }
989 } else {
990 for (let i = 0; i < this.values.length; i++) {
991 this.values[i] *= args;
992 }
993 }
994
995 return this;
996 }
997
998 /**
999 * Divides a vector's components.

Callers 15

normalizeMethod · 0.95
slerpMethod · 0.95
drawFunction · 0.45
attractor.jsFile · 0.45
mover.jsFile · 0.45
flockMethod · 0.45
updateMethod · 0.45
seekMethod · 0.45
separateMethod · 0.45
alignMethod · 0.45
updateMethod · 0.45
liquid.jsFile · 0.45

Calls 5

_friendlyErrorMethod · 0.95
shrinkToDimensionFunction · 0.85
copyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected