@@ -24,7 +24,7 @@ export function create() {
24
24
/**
25
25
* Creates a new mat2 initialized with values from an existing matrix
26
26
*
27
- * @param {mat2 } a matrix to clone
27
+ * @param {ReadonlyMat2 } a matrix to clone
28
28
* @returns {mat2 } a new 2x2 matrix
29
29
*/
30
30
export function clone ( a ) {
@@ -40,7 +40,7 @@ export function clone(a) {
40
40
* Copy the values from one mat2 to another
41
41
*
42
42
* @param {mat2 } out the receiving matrix
43
- * @param {mat2 } a the source matrix
43
+ * @param {ReadonlyMat2 } a the source matrix
44
44
* @returns {mat2 } out
45
45
*/
46
46
export function copy ( out , a ) {
@@ -105,7 +105,7 @@ export function set(out, m00, m01, m10, m11) {
105
105
* Transpose the values of a mat2
106
106
*
107
107
* @param {mat2 } out the receiving matrix
108
- * @param {mat2 } a the source matrix
108
+ * @param {ReadonlyMat2 } a the source matrix
109
109
* @returns {mat2 } out
110
110
*/
111
111
export function transpose ( out , a ) {
@@ -129,7 +129,7 @@ export function transpose(out, a) {
129
129
* Inverts a mat2
130
130
*
131
131
* @param {mat2 } out the receiving matrix
132
- * @param {mat2 } a the source matrix
132
+ * @param {ReadonlyMat2 } a the source matrix
133
133
* @returns {mat2 } out
134
134
*/
135
135
export function invert ( out , a ) {
@@ -158,7 +158,7 @@ export function invert(out, a) {
158
158
* Calculates the adjugate of a mat2
159
159
*
160
160
* @param {mat2 } out the receiving matrix
161
- * @param {mat2 } a the source matrix
161
+ * @param {ReadonlyMat2 } a the source matrix
162
162
* @returns {mat2 } out
163
163
*/
164
164
export function adjoint ( out , a ) {
@@ -175,7 +175,7 @@ export function adjoint(out, a) {
175
175
/**
176
176
* Calculates the determinant of a mat2
177
177
*
178
- * @param {mat2 } a the source matrix
178
+ * @param {ReadonlyMat2 } a the source matrix
179
179
* @returns {Number } determinant of a
180
180
*/
181
181
export function determinant ( a ) {
@@ -186,8 +186,8 @@ export function determinant(a) {
186
186
* Multiplies two mat2's
187
187
*
188
188
* @param {mat2 } out the receiving matrix
189
- * @param {mat2 } a the first operand
190
- * @param {mat2 } b the second operand
189
+ * @param {ReadonlyMat2 } a the first operand
190
+ * @param {ReadonlyMat2 } b the second operand
191
191
* @returns {mat2 } out
192
192
*/
193
193
export function multiply ( out , a , b ) {
@@ -210,7 +210,7 @@ export function multiply(out, a, b) {
210
210
* Rotates a mat2 by the given angle
211
211
*
212
212
* @param {mat2 } out the receiving matrix
213
- * @param {mat2 } a the matrix to rotate
213
+ * @param {ReadonlyMat2 } a the matrix to rotate
214
214
* @param {Number } rad the angle to rotate the matrix by
215
215
* @returns {mat2 } out
216
216
*/
@@ -232,8 +232,8 @@ export function rotate(out, a, rad) {
232
232
* Scales the mat2 by the dimensions in the given vec2
233
233
*
234
234
* @param {mat2 } out the receiving matrix
235
- * @param {mat2 } a the matrix to rotate
236
- * @param {vec2 } v the vec2 to scale the matrix by
235
+ * @param {ReadonlyMat2 } a the matrix to rotate
236
+ * @param {ReadonlyVec2 } v the vec2 to scale the matrix by
237
237
* @returns {mat2 } out
238
238
**/
239
239
export function scale ( out , a , v ) {
@@ -279,7 +279,7 @@ export function fromRotation(out, rad) {
279
279
* mat2.scale(dest, dest, vec);
280
280
*
281
281
* @param {mat2 } out mat2 receiving operation result
282
- * @param {vec2 } v Scaling vector
282
+ * @param {ReadonlyVec2 } v Scaling vector
283
283
* @returns {mat2 } out
284
284
*/
285
285
export function fromScaling ( out , v ) {
@@ -293,7 +293,7 @@ export function fromScaling(out, v) {
293
293
/**
294
294
* Returns a string representation of a mat2
295
295
*
296
- * @param {mat2 } a matrix to represent as a string
296
+ * @param {ReadonlyMat2 } a matrix to represent as a string
297
297
* @returns {String } string representation of the matrix
298
298
*/
299
299
export function str ( a ) {
@@ -303,7 +303,7 @@ export function str(a) {
303
303
/**
304
304
* Returns Frobenius norm of a mat2
305
305
*
306
- * @param {mat2 } a the matrix to calculate Frobenius norm of
306
+ * @param {ReadonlyMat2 } a the matrix to calculate Frobenius norm of
307
307
* @returns {Number } Frobenius norm
308
308
*/
309
309
export function frob ( a ) {
@@ -312,10 +312,10 @@ export function frob(a) {
312
312
313
313
/**
314
314
* Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
315
- * @param {mat2 } L the lower triangular matrix
316
- * @param {mat2 } D the diagonal matrix
317
- * @param {mat2 } U the upper triangular matrix
318
- * @param {mat2 } a the input matrix to factorize
315
+ * @param {ReadonlyMat2 } L the lower triangular matrix
316
+ * @param {ReadonlyMat2 } D the diagonal matrix
317
+ * @param {ReadonlyMat2 } U the upper triangular matrix
318
+ * @param {ReadonlyMat2 } a the input matrix to factorize
319
319
*/
320
320
321
321
export function LDU ( L , D , U , a ) {
@@ -330,8 +330,8 @@ export function LDU(L, D, U, a) {
330
330
* Adds two mat2's
331
331
*
332
332
* @param {mat2 } out the receiving matrix
333
- * @param {mat2 } a the first operand
334
- * @param {mat2 } b the second operand
333
+ * @param {ReadonlyMat2 } a the first operand
334
+ * @param {ReadonlyMat2 } b the second operand
335
335
* @returns {mat2 } out
336
336
*/
337
337
export function add ( out , a , b ) {
@@ -346,8 +346,8 @@ export function add(out, a, b) {
346
346
* Subtracts matrix b from matrix a
347
347
*
348
348
* @param {mat2 } out the receiving matrix
349
- * @param {mat2 } a the first operand
350
- * @param {mat2 } b the second operand
349
+ * @param {ReadonlyMat2 } a the first operand
350
+ * @param {ReadonlyMat2 } b the second operand
351
351
* @returns {mat2 } out
352
352
*/
353
353
export function subtract ( out , a , b ) {
@@ -361,8 +361,8 @@ export function subtract(out, a, b) {
361
361
/**
362
362
* Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
363
363
*
364
- * @param {mat2 } a The first matrix.
365
- * @param {mat2 } b The second matrix.
364
+ * @param {ReadonlyMat2 } a The first matrix.
365
+ * @param {ReadonlyMat2 } b The second matrix.
366
366
* @returns {Boolean } True if the matrices are equal, false otherwise.
367
367
*/
368
368
export function exactEquals ( a , b ) {
@@ -372,8 +372,8 @@ export function exactEquals(a, b) {
372
372
/**
373
373
* Returns whether or not the matrices have approximately the same elements in the same position.
374
374
*
375
- * @param {mat2 } a The first matrix.
376
- * @param {mat2 } b The second matrix.
375
+ * @param {ReadonlyMat2 } a The first matrix.
376
+ * @param {ReadonlyMat2 } b The second matrix.
377
377
* @returns {Boolean } True if the matrices are equal, false otherwise.
378
378
*/
379
379
export function equals ( a , b ) {
@@ -401,7 +401,7 @@ export function equals(a, b) {
401
401
* Multiply each element of the matrix by a scalar.
402
402
*
403
403
* @param {mat2 } out the receiving matrix
404
- * @param {mat2 } a the matrix to scale
404
+ * @param {ReadonlyMat2 } a the matrix to scale
405
405
* @param {Number } b amount to scale the matrix's elements by
406
406
* @returns {mat2 } out
407
407
*/
@@ -417,8 +417,8 @@ export function multiplyScalar(out, a, b) {
417
417
* Adds two mat2's after multiplying each element of the second operand by a scalar value.
418
418
*
419
419
* @param {mat2 } out the receiving vector
420
- * @param {mat2 } a the first operand
421
- * @param {mat2 } b the second operand
420
+ * @param {ReadonlyMat2 } a the first operand
421
+ * @param {ReadonlyMat2 } b the second operand
422
422
* @param {Number } scale the amount to scale b's elements by before adding
423
423
* @returns {mat2 } out
424
424
*/
0 commit comments