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

Method copy

src/math/p5.Vector.js:395–401  ·  view source on GitHub ↗

* Returns a copy of the p5.Vector object. * * @return {p5.Vector} copy of the p5.Vector object. * * @example * function setup() { * createCanvas(100 ,100); * * background(200); * * // Create a p5.Vector object.

()

Source from the content-addressed store, hash-verified

393 * }
394 */
395 copy() {
396 if (this.isPInst) {
397 return new Vector(this._fromRadians, this._toRadians, ...this.values);
398 } else {
399 return new Vector(...this.values);
400 }
401 }
402
403 /**
404 * Adds to a vector's components.

Callers 13

slerpMethod · 0.95
addMethod · 0.45
remMethod · 0.45
subMethod · 0.45
multMethod · 0.45
rotateMethod · 0.45
divMethod · 0.45
lerpMethod · 0.45
slerpMethod · 0.45
normalizeMethod · 0.45
limitMethod · 0.45
setMagMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected