@lakuna/umath 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/linalg/DualQuaternion.d.ts +46 -46
- package/dist/linalg/DualQuaternion.d.ts.map +1 -1
- package/dist/linalg/DualQuaternion.js.map +1 -1
- package/dist/linalg/Matrix.d.ts +7 -7
- package/dist/linalg/Matrix.d.ts.map +1 -1
- package/dist/linalg/Matrix2.d.ts +25 -25
- package/dist/linalg/Matrix2.d.ts.map +1 -1
- package/dist/linalg/Matrix2.js.map +1 -1
- package/dist/linalg/Matrix3.d.ts +35 -35
- package/dist/linalg/Matrix3.d.ts.map +1 -1
- package/dist/linalg/Matrix3.js.map +1 -1
- package/dist/linalg/Matrix4.d.ts +56 -56
- package/dist/linalg/Matrix4.d.ts.map +1 -1
- package/dist/linalg/Matrix4.js.map +1 -1
- package/dist/linalg/Quaternion.d.ts +44 -43
- package/dist/linalg/Quaternion.d.ts.map +1 -1
- package/dist/linalg/Quaternion.js.map +1 -1
- package/dist/linalg/SlowMatrix.d.ts +8 -8
- package/dist/linalg/SlowMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowMatrix.js.map +1 -1
- package/dist/linalg/SlowSquareMatrix.d.ts +1 -1
- package/dist/linalg/SlowSquareMatrix.d.ts.map +1 -1
- package/dist/linalg/SlowSquareMatrix.js.map +1 -1
- package/dist/linalg/SlowVector.d.ts +15 -15
- package/dist/linalg/SlowVector.d.ts.map +1 -1
- package/dist/linalg/SlowVector.js.map +1 -1
- package/dist/linalg/Vector.d.ts +14 -14
- package/dist/linalg/Vector.d.ts.map +1 -1
- package/dist/linalg/Vector2.d.ts +51 -51
- package/dist/linalg/Vector2.d.ts.map +1 -1
- package/dist/linalg/Vector2.js.map +1 -1
- package/dist/linalg/Vector3.d.ts +60 -60
- package/dist/linalg/Vector3.d.ts.map +1 -1
- package/dist/linalg/Vector3.js.map +1 -1
- package/dist/linalg/Vector4.d.ts +45 -45
- package/dist/linalg/Vector4.d.ts.map +1 -1
- package/dist/linalg/Vector4.js.map +1 -1
- package/dist/types/AxisAngle.d.ts +10 -0
- package/dist/types/AxisAngle.d.ts.map +1 -1
- package/dist/utility/BigNumber.d.ts +5 -5
- package/dist/utility/BigNumber.d.ts.map +1 -1
- package/dist/utility/BigNumber.js +13 -6
- package/dist/utility/BigNumber.js.map +1 -1
- package/package.json +4 -5
- package/src/index.ts +4 -1
- package/src/linalg/DualQuaternion.ts +69 -58
- package/src/linalg/Matrix.ts +10 -7
- package/src/linalg/Matrix2.ts +43 -32
- package/src/linalg/Matrix3.ts +53 -41
- package/src/linalg/Matrix4.ts +98 -84
- package/src/linalg/Quaternion.ts +75 -60
- package/src/linalg/SlowMatrix.ts +12 -9
- package/src/linalg/SlowSquareMatrix.ts +1 -1
- package/src/linalg/SlowVector.ts +16 -16
- package/src/linalg/Vector.ts +14 -14
- package/src/linalg/Vector2.ts +104 -76
- package/src/linalg/Vector3.ts +125 -92
- package/src/linalg/Vector4.ts +93 -62
- package/src/types/AxisAngle.ts +12 -0
- package/src/utility/BigNumber.ts +22 -11
package/dist/linalg/Matrix.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default interface Matrix extends MatrixLike {
|
|
|
11
11
|
* @returns The sum of the matrices.
|
|
12
12
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
13
13
|
*/
|
|
14
|
-
add: (matrix: Matrix4Like) => MatrixLike;
|
|
14
|
+
add: (matrix: Readonly<Matrix4Like>) => MatrixLike;
|
|
15
15
|
/**
|
|
16
16
|
* Create a copy of this matrix.
|
|
17
17
|
* @returns A copy of this matrix.
|
|
@@ -22,19 +22,19 @@ export default interface Matrix extends MatrixLike {
|
|
|
22
22
|
* @param matrix - The matrix to copy.
|
|
23
23
|
* @returns This matrix.
|
|
24
24
|
*/
|
|
25
|
-
copy: (matrix: Matrix4Like) => this;
|
|
25
|
+
copy: (matrix: Readonly<Matrix4Like>) => this;
|
|
26
26
|
/**
|
|
27
27
|
* Determine whether or not this matrix is roughly equivalent to another.
|
|
28
28
|
* @param matrix - The other matrix.
|
|
29
29
|
* @returns Whether the matrices are equivalent.
|
|
30
30
|
*/
|
|
31
|
-
equals: (matrix: Matrix4Like) => boolean;
|
|
31
|
+
equals: (matrix: Readonly<Matrix4Like>) => boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Determine whether or not this matrix is exactly equivalent to another.
|
|
34
34
|
* @param matrix - The other matrix.
|
|
35
35
|
* @returns Whether the matrices are equivalent.
|
|
36
36
|
*/
|
|
37
|
-
exactEquals: (matrix: Matrix4Like) => boolean;
|
|
37
|
+
exactEquals: (matrix: Readonly<Matrix4Like>) => boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Get the Frobenius norm of this matrix.
|
|
40
40
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_norm | Matrix norm}
|
|
@@ -48,7 +48,7 @@ export default interface Matrix extends MatrixLike {
|
|
|
48
48
|
* @returns The product of the matrices.
|
|
49
49
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
50
50
|
*/
|
|
51
|
-
multiply: (matrix: Matrix4Like) => MatrixLike;
|
|
51
|
+
multiply: (matrix: Readonly<Matrix4Like>) => MatrixLike;
|
|
52
52
|
/**
|
|
53
53
|
* Multiply this matrix by a scalar value.
|
|
54
54
|
* @param scalar - The scalar value.
|
|
@@ -64,14 +64,14 @@ export default interface Matrix extends MatrixLike {
|
|
|
64
64
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
65
65
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
66
66
|
*/
|
|
67
|
-
multiplyScalarAndAdd: (matrix: Matrix4Like
|
|
67
|
+
multiplyScalarAndAdd: (matrix: Readonly<Matrix4Like>, scalar: number) => MatrixLike;
|
|
68
68
|
/**
|
|
69
69
|
* Subtract another matrix from this one.
|
|
70
70
|
* @param matrix - The other matrix.
|
|
71
71
|
* @returns The difference between the matrices.
|
|
72
72
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
73
73
|
*/
|
|
74
|
-
subtract: (matrix: Matrix4Like) => MatrixLike;
|
|
74
|
+
subtract: (matrix: Readonly<Matrix4Like>) => MatrixLike;
|
|
75
75
|
/**
|
|
76
76
|
* Transpose this matrix.
|
|
77
77
|
* @returns The transpose of this matrix.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix.d.ts","sourceRoot":"","sources":["../../src/linalg/Matrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,MAAO,SAAQ,UAAU;IACjD;;;;;OAKG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Matrix.d.ts","sourceRoot":"","sources":["../../src/linalg/Matrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,MAAO,SAAQ,UAAU;IACjD;;;;;OAKG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,UAAU,CAAC;IAEnD;;;OAGG;IACH,KAAK,EAAE,MAAM,UAAU,CAAC;IAExB;;;;OAIG;IACH,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAE9C;;;;OAIG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAEnD;;;;OAIG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAExD;;;OAGG;IACH,IAAI,IAAI,IAAI,MAAM,CAAC;IAEnB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,UAAU,CAAC;IAExD;;;;;OAKG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU,CAAC;IAE/C;;;;;;;OAOG;IACH,oBAAoB,EAAE,CACrB,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC7B,MAAM,EAAE,MAAM,KACV,UAAU,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,KAAK,UAAU,CAAC;IAExD;;;;OAIG;IACH,SAAS,EAAE,MAAM,UAAU,CAAC;IAE5B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/linalg/Matrix2.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare const fromRotation: <T extends Matrix2Like>(r: number, out: T) =>
|
|
|
50
50
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
51
51
|
* @public
|
|
52
52
|
*/
|
|
53
|
-
export declare const fromScaling: <T extends Matrix2Like>(vector: Vector2Like
|
|
53
|
+
export declare const fromScaling: <T extends Matrix2Like>(vector: Readonly<Vector2Like>, out: T) => T;
|
|
54
54
|
/**
|
|
55
55
|
* Determine whether or not two matrices are roughly equivalent.
|
|
56
56
|
* @param a - The first matrix.
|
|
@@ -58,7 +58,7 @@ export declare const fromScaling: <T extends Matrix2Like>(vector: Vector2Like, o
|
|
|
58
58
|
* @returns Whether or not the matrices are equivalent.
|
|
59
59
|
* @public
|
|
60
60
|
*/
|
|
61
|
-
export declare const equals: (a: Matrix2Like
|
|
61
|
+
export declare const equals: (a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>) => boolean;
|
|
62
62
|
/**
|
|
63
63
|
* Determine whether or not two matrices are exactly equivalent.
|
|
64
64
|
* @param a - The first matrix.
|
|
@@ -66,7 +66,7 @@ export declare const equals: (a: Matrix2Like, b: Matrix2Like) => boolean;
|
|
|
66
66
|
* @returns Whether the matrices are equivalent.
|
|
67
67
|
* @public
|
|
68
68
|
*/
|
|
69
|
-
export declare const exactEquals: (a: Matrix2Like
|
|
69
|
+
export declare const exactEquals: (a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>) => boolean;
|
|
70
70
|
/**
|
|
71
71
|
* Add two matrices.
|
|
72
72
|
* @param a - The augend.
|
|
@@ -76,7 +76,7 @@ export declare const exactEquals: (a: Matrix2Like, b: Matrix2Like) => boolean;
|
|
|
76
76
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
|
-
export declare const add: <T extends Matrix2Like>(a: Matrix2Like
|
|
79
|
+
export declare const add: <T extends Matrix2Like>(a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>, out: T) => T;
|
|
80
80
|
/**
|
|
81
81
|
* Calculate the adjugate of a matrix.
|
|
82
82
|
* @param matrix - The matrix.
|
|
@@ -85,7 +85,7 @@ export declare const add: <T extends Matrix2Like>(a: Matrix2Like, b: Matrix2Like
|
|
|
85
85
|
* @see {@link https://en.wikipedia.org/wiki/Adjugate_matrix | Adjugate matrix}
|
|
86
86
|
* @public
|
|
87
87
|
*/
|
|
88
|
-
export declare const adjoint: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
88
|
+
export declare const adjoint: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, out: T) => T;
|
|
89
89
|
/**
|
|
90
90
|
* Copy the values from one matrix into another.
|
|
91
91
|
* @param matrix - The matrix to copy.
|
|
@@ -93,7 +93,7 @@ export declare const adjoint: <T extends Matrix2Like>(matrix: Matrix2Like, out:
|
|
|
93
93
|
* @returns The copy matrix.
|
|
94
94
|
* @public
|
|
95
95
|
*/
|
|
96
|
-
export declare const copy: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
96
|
+
export declare const copy: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, out: T) => T;
|
|
97
97
|
/**
|
|
98
98
|
* Calculate the Frobenius norm of a matrix.
|
|
99
99
|
* @param matrix - The matrix.
|
|
@@ -101,7 +101,7 @@ export declare const copy: <T extends Matrix2Like>(matrix: Matrix2Like, out: T)
|
|
|
101
101
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_norm | Matrix norm}
|
|
102
102
|
* @public
|
|
103
103
|
*/
|
|
104
|
-
export declare const frob: (matrix: Matrix2Like) => number;
|
|
104
|
+
export declare const frob: (matrix: Readonly<Matrix2Like>) => number;
|
|
105
105
|
/**
|
|
106
106
|
* Multiply one matrix by another.
|
|
107
107
|
* @param a - The multiplier.
|
|
@@ -111,7 +111,7 @@ export declare const frob: (matrix: Matrix2Like) => number;
|
|
|
111
111
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
|
-
export declare const multiply: <T extends Matrix2Like>(a: Matrix2Like
|
|
114
|
+
export declare const multiply: <T extends Matrix2Like>(a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>, out: T) => T;
|
|
115
115
|
/**
|
|
116
116
|
* Multiply a matrix by a scalar value.
|
|
117
117
|
* @param matrix - The multiplier.
|
|
@@ -121,7 +121,7 @@ export declare const multiply: <T extends Matrix2Like>(a: Matrix2Like, b: Matrix
|
|
|
121
121
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
122
122
|
* @public
|
|
123
123
|
*/
|
|
124
|
-
export declare const multiplyScalar: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
124
|
+
export declare const multiplyScalar: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, scalar: number, out: T) => T;
|
|
125
125
|
/**
|
|
126
126
|
* Add a matrix to another after multiplying the other by a scalar.
|
|
127
127
|
* @param a - The augend.
|
|
@@ -133,7 +133,7 @@ export declare const multiplyScalar: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
|
133
133
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
134
134
|
* @public
|
|
135
135
|
*/
|
|
136
|
-
export declare const multiplyScalarAndAdd: <T extends Matrix2Like>(a: Matrix2Like
|
|
136
|
+
export declare const multiplyScalarAndAdd: <T extends Matrix2Like>(a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>, scalar: number, out: T) => T;
|
|
137
137
|
/**
|
|
138
138
|
* Subtract one matrix from another.
|
|
139
139
|
* @param a - The minuend.
|
|
@@ -143,7 +143,7 @@ export declare const multiplyScalarAndAdd: <T extends Matrix2Like>(a: Matrix2Lik
|
|
|
143
143
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
144
144
|
* @public
|
|
145
145
|
*/
|
|
146
|
-
export declare const subtract: <T extends Matrix2Like>(a: Matrix2Like
|
|
146
|
+
export declare const subtract: <T extends Matrix2Like>(a: Readonly<Matrix2Like>, b: Readonly<Matrix2Like>, out: T) => T;
|
|
147
147
|
/**
|
|
148
148
|
* Transpose a matrix.
|
|
149
149
|
* @param matrix - The matrix.
|
|
@@ -152,7 +152,7 @@ export declare const subtract: <T extends Matrix2Like>(a: Matrix2Like, b: Matrix
|
|
|
152
152
|
* @see {@link https://en.wikipedia.org/wiki/Transpose | Transpose}
|
|
153
153
|
* @public
|
|
154
154
|
*/
|
|
155
|
-
export declare const transpose: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
155
|
+
export declare const transpose: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, out: T) => T;
|
|
156
156
|
/**
|
|
157
157
|
* Calculate the determinant of a matrix.
|
|
158
158
|
* @param matrix - The matrix.
|
|
@@ -160,7 +160,7 @@ export declare const transpose: <T extends Matrix2Like>(matrix: Matrix2Like, out
|
|
|
160
160
|
* @see {@link https://en.wikipedia.org/wiki/Determinant | Determinant}
|
|
161
161
|
* @public
|
|
162
162
|
*/
|
|
163
|
-
export declare const determinant: (matrix: Matrix2Like) => number;
|
|
163
|
+
export declare const determinant: (matrix: Readonly<Matrix2Like>) => number;
|
|
164
164
|
/**
|
|
165
165
|
* Reset a matrix to identity.
|
|
166
166
|
* @param out - The matrix to store the result in.
|
|
@@ -177,7 +177,7 @@ export declare const identity: <T extends Matrix2Like>(out: T) => T;
|
|
|
177
177
|
* @see {@link https://en.wikipedia.org/wiki/Invertible_matrix | Invertible matrix}
|
|
178
178
|
* @public
|
|
179
179
|
*/
|
|
180
|
-
export declare const invert: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
180
|
+
export declare const invert: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, out: T) => T;
|
|
181
181
|
/**
|
|
182
182
|
* Rotate a matrix by the given angle.
|
|
183
183
|
* @param matrix - The matrix.
|
|
@@ -187,7 +187,7 @@ export declare const invert: <T extends Matrix2Like>(matrix: Matrix2Like, out: T
|
|
|
187
187
|
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
188
188
|
* @public
|
|
189
189
|
*/
|
|
190
|
-
export declare const rotate: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
190
|
+
export declare const rotate: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, r: number, out: T) => T;
|
|
191
191
|
/**
|
|
192
192
|
* Scale a matrix by the given vector.
|
|
193
193
|
* @param matrix - The matrix.
|
|
@@ -197,7 +197,7 @@ export declare const rotate: <T extends Matrix2Like>(matrix: Matrix2Like, r: num
|
|
|
197
197
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
198
198
|
* @public
|
|
199
199
|
*/
|
|
200
|
-
export declare const scale: <T extends Matrix2Like>(matrix: Matrix2Like
|
|
200
|
+
export declare const scale: <T extends Matrix2Like>(matrix: Readonly<Matrix2Like>, vector: Readonly<Vector2Like>, out: T) => T;
|
|
201
201
|
/**
|
|
202
202
|
* A two-by-two matrix.
|
|
203
203
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_(mathematics) | Matrix}
|
|
@@ -244,7 +244,7 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
244
244
|
* @returns The transformation matrix.
|
|
245
245
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
246
246
|
*/
|
|
247
|
-
static fromScaling(vector: Vector2Like): Matrix2;
|
|
247
|
+
static fromScaling(vector: Readonly<Vector2Like>): Matrix2;
|
|
248
248
|
/**
|
|
249
249
|
* Create a two-by-two matrix with the given values.
|
|
250
250
|
* @param c0r0 - The value in the first column and first row.
|
|
@@ -260,7 +260,7 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
260
260
|
* @returns The sum of the matrices.
|
|
261
261
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
262
262
|
*/
|
|
263
|
-
add(matrix: Matrix2Like): Matrix2;
|
|
263
|
+
add(matrix: Readonly<Matrix2Like>): Matrix2;
|
|
264
264
|
/**
|
|
265
265
|
* Calculate the adjugate of this matrix.
|
|
266
266
|
* @returns The adjugate of this matrix.
|
|
@@ -277,19 +277,19 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
277
277
|
* @param matrix - The matrix to copy.
|
|
278
278
|
* @returns This matrix.
|
|
279
279
|
*/
|
|
280
|
-
copy(matrix: Matrix2Like): this;
|
|
280
|
+
copy(matrix: Readonly<Matrix2Like>): this;
|
|
281
281
|
/**
|
|
282
282
|
* Determine whether or not this matrix is roughly equivalent to another.
|
|
283
283
|
* @param matrix - The other matrix.
|
|
284
284
|
* @returns Whether the matrices are equivalent.
|
|
285
285
|
*/
|
|
286
|
-
equals(matrix: Matrix2Like): boolean;
|
|
286
|
+
equals(matrix: Readonly<Matrix2Like>): boolean;
|
|
287
287
|
/**
|
|
288
288
|
* Determine whether or not this matrix is exactly equivalent to another.
|
|
289
289
|
* @param matrix - The other matrix.
|
|
290
290
|
* @returns Whether the matrices are equivalent.
|
|
291
291
|
*/
|
|
292
|
-
exactEquals(matrix: Matrix2Like): boolean;
|
|
292
|
+
exactEquals(matrix: Readonly<Matrix2Like>): boolean;
|
|
293
293
|
/**
|
|
294
294
|
* Reset this matrix to identity.
|
|
295
295
|
* @returns This matrix.
|
|
@@ -309,7 +309,7 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
309
309
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
310
310
|
* @public
|
|
311
311
|
*/
|
|
312
|
-
multiply(matrix: Matrix2Like): Matrix2;
|
|
312
|
+
multiply(matrix: Readonly<Matrix2Like>): Matrix2;
|
|
313
313
|
/**
|
|
314
314
|
* Multiply this matrix by a scalar value.
|
|
315
315
|
* @param scalar - The scalar value.
|
|
@@ -325,7 +325,7 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
325
325
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
326
326
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
327
327
|
*/
|
|
328
|
-
multiplyScalarAndAdd(matrix: Matrix2Like
|
|
328
|
+
multiplyScalarAndAdd(matrix: Readonly<Matrix2Like>, scalar: number): Matrix2;
|
|
329
329
|
/**
|
|
330
330
|
* Rotate this matrix by the given angle.
|
|
331
331
|
* @param r - The angle in radians.
|
|
@@ -339,14 +339,14 @@ export default class Matrix2 extends Float32Array implements Matrix2Like, Square
|
|
|
339
339
|
* @returns The scaled matrix.
|
|
340
340
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
341
341
|
*/
|
|
342
|
-
scale(vector: Vector2Like): Matrix2;
|
|
342
|
+
scale(vector: Readonly<Vector2Like>): Matrix2;
|
|
343
343
|
/**
|
|
344
344
|
* Subtract another matrix from this one.
|
|
345
345
|
* @param matrix - The other matrix.
|
|
346
346
|
* @returns The difference between the matrices.
|
|
347
347
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
348
348
|
*/
|
|
349
|
-
subtract(matrix: Matrix2Like): Matrix2;
|
|
349
|
+
subtract(matrix: Readonly<Matrix2Like>): Matrix2;
|
|
350
350
|
/**
|
|
351
351
|
* Transpose this matrix.
|
|
352
352
|
* @returns The transpose of this matrix.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix2.d.ts","sourceRoot":"","sources":["../../src/linalg/Matrix2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAehD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC9C,mDAAmD;IAEnD,CAAC,EAAE,MAAM,CAAC;IAEV,oDAAoD;IAEpD,CAAC,EAAE,MAAM,CAAC;IAEV,oDAAoD;IAEpD,CAAC,EAAE,MAAM,CAAC;IAEV,qDAAqD;IAErD,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,YAAY,GAAG,WAEF,CAAC;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,WAAW,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,KACF,CAAqB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ACI,oBAAoB,CAC1B,MAA6B,EAC7B,MAAc;QAEd,OAAO,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,CAAS;QACtB,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAA6B;QACzC,OAAO,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,MAA6B;QAC5C,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACI,SAAS;QACf,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;CACD"}
|
package/dist/linalg/Matrix3.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare const fromRotation: <T extends Matrix3Like>(r: number, out: T) =>
|
|
|
67
67
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
68
68
|
* @public
|
|
69
69
|
*/
|
|
70
|
-
export declare const fromScaling: <T extends Matrix3Like>(vector: Vector2Like
|
|
70
|
+
export declare const fromScaling: <T extends Matrix3Like>(vector: Readonly<Vector2Like>, out: T) => T;
|
|
71
71
|
/**
|
|
72
72
|
* Create a transformation matrix that represents a translation by the given vector. Equivalent to (but faster than) `translate(identity(out), vector, out)`.
|
|
73
73
|
* @param vector - The translation vector.
|
|
@@ -76,7 +76,7 @@ export declare const fromScaling: <T extends Matrix3Like>(vector: Vector2Like, o
|
|
|
76
76
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
|
-
export declare const fromTranslation: <T extends Matrix3Like>(vector: Vector2Like
|
|
79
|
+
export declare const fromTranslation: <T extends Matrix3Like>(vector: Readonly<Vector2Like>, out: T) => T;
|
|
80
80
|
/**
|
|
81
81
|
* Create a transformation matrix that represents a rotation by the given quaternion.
|
|
82
82
|
* @param quaternion - The quaternion.
|
|
@@ -86,7 +86,7 @@ export declare const fromTranslation: <T extends Matrix3Like>(vector: Vector2Lik
|
|
|
86
86
|
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
|
-
export declare const fromQuaternion: <T extends Matrix3Like>(quaternion: QuaternionLike
|
|
89
|
+
export declare const fromQuaternion: <T extends Matrix3Like>(quaternion: Readonly<QuaternionLike>, out: T) => T;
|
|
90
90
|
/**
|
|
91
91
|
* Create a transformation matrix that represents a rotation by the given z-y'-x" (intrinsic) Tait-Bryan angles.
|
|
92
92
|
* @param z - The z (roll) angle.
|
|
@@ -106,7 +106,7 @@ export declare const fromEuler: <T extends Matrix3Like>(z: number, y: number, x:
|
|
|
106
106
|
* @see {@link https://en.wikipedia.org/wiki/Normal_matrix | Normal matrix}
|
|
107
107
|
* @public
|
|
108
108
|
*/
|
|
109
|
-
export declare const normalFromMatrix4: <T extends Matrix3Like>(matrix: Matrix4Like
|
|
109
|
+
export declare const normalFromMatrix4: <T extends Matrix3Like>(matrix: Readonly<Matrix4Like>, out: T) => T;
|
|
110
110
|
/**
|
|
111
111
|
* Generate a two-dimensional projection matrix with the given bounds.
|
|
112
112
|
* @param width - The width of the projection.
|
|
@@ -125,7 +125,7 @@ export declare const projection: <T extends Matrix3Like>(width: number, height:
|
|
|
125
125
|
* @returns The three-by-three matrix.
|
|
126
126
|
* @public
|
|
127
127
|
*/
|
|
128
|
-
export declare const fromMatrix4: <T extends Matrix3Like>(matrix: Matrix4Like
|
|
128
|
+
export declare const fromMatrix4: <T extends Matrix3Like>(matrix: Readonly<Matrix4Like>, out: T) => T;
|
|
129
129
|
/**
|
|
130
130
|
* Determine whether or not two matrices are roughly equivalent.
|
|
131
131
|
* @param a - The first matrix.
|
|
@@ -133,7 +133,7 @@ export declare const fromMatrix4: <T extends Matrix3Like>(matrix: Matrix4Like, o
|
|
|
133
133
|
* @returns Whether or not the matrices are equivalent.
|
|
134
134
|
* @public
|
|
135
135
|
*/
|
|
136
|
-
export declare const equals: (a: Matrix3Like
|
|
136
|
+
export declare const equals: (a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>) => boolean;
|
|
137
137
|
/**
|
|
138
138
|
* Determine whether or not two matrices are exactly equivalent.
|
|
139
139
|
* @param a - The first matrix.
|
|
@@ -141,7 +141,7 @@ export declare const equals: (a: Matrix3Like, b: Matrix3Like) => boolean;
|
|
|
141
141
|
* @returns Whether or not the matrices are equivalent.
|
|
142
142
|
* @public
|
|
143
143
|
*/
|
|
144
|
-
export declare const exactEquals: (a: Matrix3Like
|
|
144
|
+
export declare const exactEquals: (a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>) => boolean;
|
|
145
145
|
/**
|
|
146
146
|
* Add two matrices.
|
|
147
147
|
* @param a - The augend.
|
|
@@ -151,7 +151,7 @@ export declare const exactEquals: (a: Matrix3Like, b: Matrix3Like) => boolean;
|
|
|
151
151
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
152
152
|
* @public
|
|
153
153
|
*/
|
|
154
|
-
export declare const add: <T extends Matrix3Like>(a: Matrix3Like
|
|
154
|
+
export declare const add: <T extends Matrix3Like>(a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>, out: T) => T;
|
|
155
155
|
/**
|
|
156
156
|
* Calculate the adjugate of a matrix.
|
|
157
157
|
* @param matrix - The matrix.
|
|
@@ -160,7 +160,7 @@ export declare const add: <T extends Matrix3Like>(a: Matrix3Like, b: Matrix3Like
|
|
|
160
160
|
* @see {@link https://en.wikipedia.org/wiki/Adjugate_matrix | Adjugate matrix}
|
|
161
161
|
* @public
|
|
162
162
|
*/
|
|
163
|
-
export declare const adjoint: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
163
|
+
export declare const adjoint: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, out: T) => T;
|
|
164
164
|
/**
|
|
165
165
|
* Copy the values of one matrix into another.
|
|
166
166
|
* @param matrix - The matrix to copy.
|
|
@@ -168,7 +168,7 @@ export declare const adjoint: <T extends Matrix3Like>(matrix: Matrix3Like, out:
|
|
|
168
168
|
* @returns The copy matrix.
|
|
169
169
|
* @public
|
|
170
170
|
*/
|
|
171
|
-
export declare const copy: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
171
|
+
export declare const copy: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, out: T) => T;
|
|
172
172
|
/**
|
|
173
173
|
* Calculate the Frobenius norm of a matrix.
|
|
174
174
|
* @param matrix - The matrix.
|
|
@@ -176,7 +176,7 @@ export declare const copy: <T extends Matrix3Like>(matrix: Matrix3Like, out: T)
|
|
|
176
176
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_norm | Matrix norm}
|
|
177
177
|
* @public
|
|
178
178
|
*/
|
|
179
|
-
export declare const frob: (matrix: Matrix3Like) => number;
|
|
179
|
+
export declare const frob: (matrix: Readonly<Matrix3Like>) => number;
|
|
180
180
|
/**
|
|
181
181
|
* Multiply two matrices.
|
|
182
182
|
* @param a - The multiplier.
|
|
@@ -186,7 +186,7 @@ export declare const frob: (matrix: Matrix3Like) => number;
|
|
|
186
186
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
187
187
|
* @public
|
|
188
188
|
*/
|
|
189
|
-
export declare const multiply: <T extends Matrix3Like>(a: Matrix3Like
|
|
189
|
+
export declare const multiply: <T extends Matrix3Like>(a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>, out: T) => T;
|
|
190
190
|
/**
|
|
191
191
|
* Multiply a matrix by a scalar value.
|
|
192
192
|
* @param matrix - The multiplicand.
|
|
@@ -196,7 +196,7 @@ export declare const multiply: <T extends Matrix3Like>(a: Matrix3Like, b: Matrix
|
|
|
196
196
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
197
197
|
* @public
|
|
198
198
|
*/
|
|
199
|
-
export declare const multiplyScalar: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
199
|
+
export declare const multiplyScalar: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, scalar: number, out: T) => T;
|
|
200
200
|
/**
|
|
201
201
|
* Add a matrix to another after multiplying the other by a scalar.
|
|
202
202
|
* @param a - The augend.
|
|
@@ -208,7 +208,7 @@ export declare const multiplyScalar: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
|
208
208
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
209
209
|
* @public
|
|
210
210
|
*/
|
|
211
|
-
export declare const multiplyScalarAndAdd: <T extends Matrix3Like>(a: Matrix3Like
|
|
211
|
+
export declare const multiplyScalarAndAdd: <T extends Matrix3Like>(a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>, scalar: number, out: T) => T;
|
|
212
212
|
/**
|
|
213
213
|
* Subtract two matrices.
|
|
214
214
|
* @param a - The minuend.
|
|
@@ -218,7 +218,7 @@ export declare const multiplyScalarAndAdd: <T extends Matrix3Like>(a: Matrix3Lik
|
|
|
218
218
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
219
219
|
* @public
|
|
220
220
|
*/
|
|
221
|
-
export declare const subtract: <T extends Matrix3Like>(a: Matrix3Like
|
|
221
|
+
export declare const subtract: <T extends Matrix3Like>(a: Readonly<Matrix3Like>, b: Readonly<Matrix3Like>, out: T) => T;
|
|
222
222
|
/**
|
|
223
223
|
* Transpose a matrix.
|
|
224
224
|
* @param matrix - The matrix.
|
|
@@ -227,7 +227,7 @@ export declare const subtract: <T extends Matrix3Like>(a: Matrix3Like, b: Matrix
|
|
|
227
227
|
* @see {@link https://en.wikipedia.org/wiki/Transpose | Transpose}
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
|
-
export declare const transpose: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
230
|
+
export declare const transpose: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, out: T) => T;
|
|
231
231
|
/**
|
|
232
232
|
* Calculate the determinant of a matrix.
|
|
233
233
|
* @param matrix - The matrix.
|
|
@@ -235,7 +235,7 @@ export declare const transpose: <T extends Matrix3Like>(matrix: Matrix3Like, out
|
|
|
235
235
|
* @see {@link https://en.wikipedia.org/wiki/Determinant | Determinant}
|
|
236
236
|
* @public
|
|
237
237
|
*/
|
|
238
|
-
export declare const determinant: (matrix: Matrix3Like) => number;
|
|
238
|
+
export declare const determinant: (matrix: Readonly<Matrix3Like>) => number;
|
|
239
239
|
/**
|
|
240
240
|
* Reset a matrix to identity.
|
|
241
241
|
* @param out - The matrix to store the result in.
|
|
@@ -252,7 +252,7 @@ export declare const identity: <T extends Matrix3Like>(out: T) => T;
|
|
|
252
252
|
* @see {@link https://en.wikipedia.org/wiki/Invertible_matrix | Invertible matrix}
|
|
253
253
|
* @public
|
|
254
254
|
*/
|
|
255
|
-
export declare const invert: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
255
|
+
export declare const invert: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, out: T) => T;
|
|
256
256
|
/**
|
|
257
257
|
* Rotate a matrix by the given angle around the Z-axis.
|
|
258
258
|
* @param matrix - The matrix.
|
|
@@ -262,7 +262,7 @@ export declare const invert: <T extends Matrix3Like>(matrix: Matrix3Like, out: T
|
|
|
262
262
|
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
263
263
|
* @public
|
|
264
264
|
*/
|
|
265
|
-
export declare const rotate: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
265
|
+
export declare const rotate: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, radians: number, out: T) => T;
|
|
266
266
|
/**
|
|
267
267
|
* Scale a matrix by the given vector.
|
|
268
268
|
* @param matrix - The matrix.
|
|
@@ -272,7 +272,7 @@ export declare const rotate: <T extends Matrix3Like>(matrix: Matrix3Like, radian
|
|
|
272
272
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
273
273
|
* @public
|
|
274
274
|
*/
|
|
275
|
-
export declare const scale: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
275
|
+
export declare const scale: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, vector: Readonly<Vector2Like>, out: T) => T;
|
|
276
276
|
/**
|
|
277
277
|
* Translate a matrix by the given vector.
|
|
278
278
|
* @param matrix - The matrix.
|
|
@@ -282,7 +282,7 @@ export declare const scale: <T extends Matrix3Like>(matrix: Matrix3Like, vector:
|
|
|
282
282
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
283
283
|
* @public
|
|
284
284
|
*/
|
|
285
|
-
export declare const translate: <T extends Matrix3Like>(matrix: Matrix3Like
|
|
285
|
+
export declare const translate: <T extends Matrix3Like>(matrix: Readonly<Matrix3Like>, vector: Readonly<Vector2Like>, out: T) => T;
|
|
286
286
|
/**
|
|
287
287
|
* A three-by-three matrix.
|
|
288
288
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_(mathematics) | Matrix}
|
|
@@ -341,7 +341,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
341
341
|
* @param matrix - The four-by-four matrix.
|
|
342
342
|
* @returns The three-by-three matrix.
|
|
343
343
|
*/
|
|
344
|
-
static fromMatrix4(matrix: Matrix4Like): Matrix3;
|
|
344
|
+
static fromMatrix4(matrix: Readonly<Matrix4Like>): Matrix3;
|
|
345
345
|
/**
|
|
346
346
|
* Create a transformation matrix that represents a rotation by the given quaternion.
|
|
347
347
|
* @param quaternion - The quaternion.
|
|
@@ -349,7 +349,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
349
349
|
* @see {@link https://en.wikipedia.org/wiki/Quaternion | Quaternion}
|
|
350
350
|
* @see {@link https://en.wikipedia.org/wiki/Rotation_matrix | Rotation matrix}
|
|
351
351
|
*/
|
|
352
|
-
static fromQuaternion(quaternion: QuaternionLike): Matrix3;
|
|
352
|
+
static fromQuaternion(quaternion: Readonly<QuaternionLike>): Matrix3;
|
|
353
353
|
/**
|
|
354
354
|
* Create a transformation matrix that represents a rotation by the given angle around the Z-axis.
|
|
355
355
|
* @param r - The angle in radians.
|
|
@@ -363,14 +363,14 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
363
363
|
* @returns The transformation matrix.
|
|
364
364
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
365
365
|
*/
|
|
366
|
-
static fromScaling(vector: Vector2Like): Matrix3;
|
|
366
|
+
static fromScaling(vector: Readonly<Vector2Like>): Matrix3;
|
|
367
367
|
/**
|
|
368
368
|
* Create a transformation matrix that represents a translation by the given vector.
|
|
369
369
|
* @param vector - The translation vector.
|
|
370
370
|
* @returns The transformation matrix.
|
|
371
371
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
372
372
|
*/
|
|
373
|
-
static fromTranslation(vector: Vector2Like): Matrix3;
|
|
373
|
+
static fromTranslation(vector: Readonly<Vector2Like>): Matrix3;
|
|
374
374
|
/**
|
|
375
375
|
* Create a two-by-two matrix with the given values.
|
|
376
376
|
* @param c0r0 - The value in the first column and first row.
|
|
@@ -391,7 +391,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
391
391
|
* @returns The normal matrix.
|
|
392
392
|
* @see {@link https://en.wikipedia.org/wiki/Normal_matrix | Normal matrix}
|
|
393
393
|
*/
|
|
394
|
-
static normalFromMatrix4(matrix: Matrix4Like): Matrix3;
|
|
394
|
+
static normalFromMatrix4(matrix: Readonly<Matrix4Like>): Matrix3;
|
|
395
395
|
/**
|
|
396
396
|
* Generate a two-dimensional projection matrix with the given bounds.
|
|
397
397
|
* @param width - The width of the projection.
|
|
@@ -407,7 +407,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
407
407
|
* @returns The sum of the matrices.
|
|
408
408
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
409
409
|
*/
|
|
410
|
-
add(matrix: Matrix3Like): Matrix3;
|
|
410
|
+
add(matrix: Readonly<Matrix3Like>): Matrix3;
|
|
411
411
|
/**
|
|
412
412
|
* Calculate the adjugate of this matrix.
|
|
413
413
|
* @returns The adjugate of this matrix.
|
|
@@ -424,19 +424,19 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
424
424
|
* @param matrix - The matrix to copy.
|
|
425
425
|
* @returns This matrix.
|
|
426
426
|
*/
|
|
427
|
-
copy(matrix: Matrix3Like): this;
|
|
427
|
+
copy(matrix: Readonly<Matrix3Like>): this;
|
|
428
428
|
/**
|
|
429
429
|
* Determine whether or not this matrix is roughly equivalent to another.
|
|
430
430
|
* @param matrix - The other matrix.
|
|
431
431
|
* @returns Whether or not the matrices are equivalent.
|
|
432
432
|
*/
|
|
433
|
-
equals(matrix: Matrix3Like): boolean;
|
|
433
|
+
equals(matrix: Readonly<Matrix3Like>): boolean;
|
|
434
434
|
/**
|
|
435
435
|
* Determine whether or not this matrix is exactly equivalent to another.
|
|
436
436
|
* @param matrix - The other matrix.
|
|
437
437
|
* @returns Whether or not the matrices are equivalent.
|
|
438
438
|
*/
|
|
439
|
-
exactEquals(matrix: Matrix3Like): boolean;
|
|
439
|
+
exactEquals(matrix: Readonly<Matrix3Like>): boolean;
|
|
440
440
|
/**
|
|
441
441
|
* Reset this matrix to identity.
|
|
442
442
|
* @returns This matrix.
|
|
@@ -455,7 +455,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
455
455
|
* @returns The product of the matrices.
|
|
456
456
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
457
457
|
*/
|
|
458
|
-
multiply(matrix: Matrix3Like): Matrix3;
|
|
458
|
+
multiply(matrix: Readonly<Matrix3Like>): Matrix3;
|
|
459
459
|
/**
|
|
460
460
|
* Multiply this matrix by a scalar value.
|
|
461
461
|
* @param scalar - The scalar value.
|
|
@@ -471,7 +471,7 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
471
471
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
472
472
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_multiplication | Matrix multiplication}
|
|
473
473
|
*/
|
|
474
|
-
multiplyScalarAndAdd(matrix: Matrix3Like
|
|
474
|
+
multiplyScalarAndAdd(matrix: Readonly<Matrix3Like>, scalar: number): Matrix3;
|
|
475
475
|
/**
|
|
476
476
|
* Rotate this matrix by the given angle around the Z-axis.
|
|
477
477
|
* @param r - The angle in radians.
|
|
@@ -485,21 +485,21 @@ export default class Matrix3 extends Float32Array implements Matrix3Like, Square
|
|
|
485
485
|
* @returns The scaled matrix.
|
|
486
486
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
487
487
|
*/
|
|
488
|
-
scale(vector: Vector2Like): Matrix3;
|
|
488
|
+
scale(vector: Readonly<Vector2Like>): Matrix3;
|
|
489
489
|
/**
|
|
490
490
|
* Subtract another matrix from this one.
|
|
491
491
|
* @param matrix - The other matrix.
|
|
492
492
|
* @returns The difference between the matrices.
|
|
493
493
|
* @see {@link https://en.wikipedia.org/wiki/Matrix_addition | Matrix addition}
|
|
494
494
|
*/
|
|
495
|
-
subtract(matrix: Matrix3Like): Matrix3;
|
|
495
|
+
subtract(matrix: Readonly<Matrix3Like>): Matrix3;
|
|
496
496
|
/**
|
|
497
497
|
* Translate this matrix by the given vector.
|
|
498
498
|
* @param vector - The translation vector.
|
|
499
499
|
* @returns The translated matrix.
|
|
500
500
|
* @see {@link https://en.wikipedia.org/wiki/Transformation_matrix | Transformation matrix}
|
|
501
501
|
*/
|
|
502
|
-
translate(vector: Vector2Like): Matrix3;
|
|
502
|
+
translate(vector: Readonly<Vector2Like>): Matrix3;
|
|
503
503
|
/**
|
|
504
504
|
* Transpose this matrix.
|
|
505
505
|
* @returns The transpose of this matrix.
|