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

Method multiplyDirection

src/math/Matrices/Matrix.js:1548–1551  ·  view source on GitHub ↗

* Applies a matrix to a vector. * The fourth component is set to 0. * Returns a vector consisting of the first * through third components of the result. * * This method multiplies the current matrix by a 4D vector (x, y, z, 0), * effectively transforming the direction vector using

({ x, y, z })

Source from the content-addressed store, hash-verified

1546 * }
1547 */
1548 multiplyDirection({ x, y, z }) {
1549 const array = this.multiplyVec4(x, y, z, 0);
1550 return new Vector(array[0], array[1], array[2]);
1551 }
1552
1553 /**
1554 * Takes a vector and returns the vector resulting from multiplying. This function is only for 3x3 matrices.

Callers

nothing calls this directly

Calls 1

multiplyVec4Method · 0.95

Tested by

no test coverage detected