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

Method sub

src/math/p5.Vector.js:793–802  ·  view source on GitHub ↗

* @param {p5.Vector|Number[]} value the vector to subtract * @chainable

(args)

Source from the content-addressed store, hash-verified

791 * @chainable
792 */
793 sub(args) {
794 const minDimension = prioritizeSmallerDimension(this.dimensions, args);
795 shrinkToDimension(this.values, minDimension);
796
797 for (let i = 0; i < this.values.length; i++) {
798 this.values[i] -= args[i];
799 }
800
801 return this;
802 }
803
804 /**
805 * Multiplies a vector's components.

Callers 15

reflectMethod · 0.95
drawFunction · 0.80
attractor.jsFile · 0.80
seekMethod · 0.80
separateMethod · 0.80
alignMethod · 0.80
attractedMethod · 0.80
p5.Vector.jsFile · 0.80
initGlobalStrandsAPIFunction · 0.80
addImmediateMethod · 0.80
saveStlMethod · 0.80
_getFaceNormalMethod · 0.80

Calls 5

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

Tested by

no test coverage detected