MCPcopy
hub / github.com/processing/p5.js / multiplyVec

Method multiplyVec

src/math/Matrices/Matrix.js:594–602  ·  view source on GitHub ↗

* Takes a vector and returns the vector resulting from multiplying to that vector by this matrix from left. This function is only for 3x3 matrices. * * This method applies the current 3x3 matrix to a given vector, effectively * transforming the vector using the matrix. The resulting vector

(multVector, target)

Source from the content-addressed store, hash-verified

592 * }
593 */
594 multiplyVec(multVector, target) {
595 if (target === undefined) {
596 target = multVector.copy();
597 }
598 for (let i = 0; i < this.#sqDimention; i++) {
599 target.values[i] = this.row(i).dot(multVector);
600 }
601 return target;
602 }
603
604 /**
605 * Inverts a given matrix.

Callers 3

slerpMethod · 0.95
p5.Matrix.jsFile · 0.80
transformNormalsMethod · 0.80

Calls 3

rowMethod · 0.95
dotMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected