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

Method cross

src/math/p5.Vector.js:1446–1455  ·  view source on GitHub ↗

* Calculates the cross product of two vectors. * * The cross product is a vector that points straight out of the plane created * by two vectors. The cross product's magnitude is the area of the parallelogram * formed by the original two vectors. * * The cross product is defined on

(v)

Source from the content-addressed store, hash-verified

1444 * }
1445 */
1446 cross(v) {
1447 const x = this.y * v.z - this.z * v.y;
1448 const y = this.z * v.x - this.x * v.z;
1449 const z = this.x * v.y - this.y * v.x;
1450 if (this.isPInst) {
1451 return new Vector(this._fromRadians, this._toRadians, x, y, z);
1452 } else {
1453 return new Vector(x, y, z);
1454 }
1455 }
1456
1457 /**
1458 * Calculates the distance between two points represented by vectors.

Callers 9

angleBetweenMethod · 0.95
slerpMethod · 0.95
p5.Vector.jsFile · 0.80
addImmediateMethod · 0.80
_getFaceNormalMethod · 0.80
_orbitMethod · 0.80
_orbitFreeMethod · 0.80
rotateVectorMethod · 0.80
textToModelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected