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

Method transpose

src/math/Matrices/Matrix.js:491–499  ·  view source on GitHub ↗

* Transposes the given matrix `a` based on the square dimension of the matrix. * * This method rearranges the elements of the matrix such that the rows become columns * and the columns become rows. It handles matrices of different dimensions (4x4, 3x3, NxN) * by delegating to specific tr

(a)

Source from the content-addressed store, hash-verified

489 * }
490 */
491 transpose(a) {
492 if (this.#sqDimention === 4) {
493 return this.#transpose4x4(a);
494 } else if (this.#sqDimention === 3) {
495 return this.#transpose3x3(a);
496 } else {
497 return this.#transposeNxN(a);
498 }
499 }
500
501 /**
502 * Multiplies the current matrix with another matrix or matrix-like array.

Callers 3

p5.Matrix.jsFile · 0.45
slerpMethod · 0.45
inverseTranspose4x4Method · 0.45

Calls 3

#transpose4x4Method · 0.95
#transpose3x3Method · 0.95
#transposeNxNMethod · 0.95

Tested by

no test coverage detected