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

Method invert

src/math/Matrices/Matrix.js:646–656  ·  view source on GitHub ↗

* Inverts a given matrix. * * This method inverts a matrix based on its dimensions. Currently, it supports * 3x3 and 4x4 matrices. If the matrix dimension is greater than 4, an error is thrown. * * For 4x4 matrices, it uses a specialized algorithm to compute the inverse. * For 3x3

(a)

Source from the content-addressed store, hash-verified

644 * }
645 */
646 invert(a) {
647 if (this.#sqDimention === 4) {
648 return this.#invert4x4(a);
649 } else if (this.#sqDimention === 3) {
650 return this.#invert3x3(a);
651 } else {
652 throw new Error(
653 'Invert is not implemented for N>4 at the moment, we are working on it'
654 );
655 }
656 }
657
658 /**
659 * Creates a 3x3 matrix whose entries are the top left 3x3 part and returns it. This function is only for 4x4 matrices.

Callers 4

inverseTranspose4x4Method · 0.95
p5.Matrix.jsFile · 0.45
_getSphereMappingMethod · 0.45
environmentFunction · 0.45

Calls 2

#invert4x4Method · 0.95
#invert3x3Method · 0.95

Tested by

no test coverage detected