@@ -64,9 +64,9 @@ export class Matrix extends Events {
64
64
/**
65
65
* @name Two.Matrix.Multiply
66
66
* @function
67
- * @param {Number[] } A
68
- * @param {Number[] } B
69
- * @param {Number[] } [C] - An optional matrix to apply the multiplication to.
67
+ * @param {Number[] } A - The first { @link Two.Matrix} to multiply
68
+ * @param {Number[] } B - The second { @link Two.Matrix} to multiply
69
+ * @param {Number[] } [C] - An optional { @link Two.Matrix} to apply the result to
70
70
* @returns {Number[] } - If an optional `C` matrix isn't passed then a new one is created and returned.
71
71
* @description Multiply two matrices together and return the result.
72
72
*/
@@ -141,22 +141,22 @@ export class Matrix extends Events {
141
141
/**
142
142
* @name Two.Matrix#set
143
143
* @function
144
- * @param {Number } a - The value for element at the first column and first row.
145
- * @param {Number } b - The value for element at the second column and first row.
146
- * @param {Number } c - The value for element at the third column and first row.
147
- * @param {Number } d - The value for element at the first column and second row.
148
- * @param {Number } e - The value for element at the second column and second row.
149
- * @param {Number } f - The value for element at the third column and second row.
150
- * @param {Number } g - The value for element at the first column and third row.
151
- * @param {Number } h - The value for element at the second column and third row.
152
- * @param {Number } i - The value for element at the third column and third row.
144
+ * @param {Number } a - The value for element at the first column and first row
145
+ * @param {Number } b - The value for element at the second column and first row
146
+ * @param {Number } c - The value for element at the third column and first row
147
+ * @param {Number } d - The value for element at the first column and second row
148
+ * @param {Number } e - The value for element at the second column and second row
149
+ * @param {Number } f - The value for element at the third column and second row
150
+ * @param {Number } g - The value for element at the first column and third row
151
+ * @param {Number } h - The value for element at the second column and third row
152
+ * @param {Number } i - The value for element at the third column and third row
153
153
* @description Set an array of values onto the matrix. Order described in {@link Two.Matrix}.
154
154
*/
155
155
156
156
/**
157
157
* @name Two.Matrix#set
158
158
* @function
159
- * @param {Number[] } a - The array of elements to apply.
159
+ * @param {Number[] } a - The array of elements to apply
160
160
* @description Set an array of values onto the matrix. Order described in {@link Two.Matrix}.
161
161
*/
162
162
set ( a , b , c , d , e , f , g , h , i ) {
@@ -189,6 +189,7 @@ export class Matrix extends Events {
189
189
/**
190
190
* @name Two.Matrix#copy
191
191
* @function
192
+ * @param {Two.Matrix } m - The matrix to copy
192
193
* @description Copy the matrix of one to the current instance.
193
194
*/
194
195
copy ( m ) {
@@ -229,17 +230,17 @@ export class Matrix extends Events {
229
230
/**
230
231
* @name Two.Matrix#multiply
231
232
* @function
232
- * @param {Number } a - The scalar to be multiplied.
233
+ * @param {Number } s - The scalar to be multiplied.
233
234
* @description Multiply all components of the matrix against a single scalar value.
234
235
* @overloaded
235
236
*/
236
237
237
238
/**
238
239
* @name Two.Matrix#multiply
239
240
* @function
240
- * @param {Number } a - The x component to be multiplied.
241
- * @param {Number } b - The y component to be multiplied.
242
- * @param {Number } c - The z component to be multiplied.
241
+ * @param {Number } x - The `x` component to be multiplied.
242
+ * @param {Number } y - The `y` component to be multiplied.
243
+ * @param {Number } z - The `z` component to be multiplied.
243
244
* @description Multiply all components of a matrix against a 3 component vector.
244
245
* @overloaded
245
246
*/
@@ -341,12 +342,12 @@ export class Matrix extends Events {
341
342
/**
342
343
* @name Two.Matrix#inverse
343
344
* @function
344
- * @param {Two.Matrix } [out ] - The optional matrix to apply the inversion to.
345
+ * @param {Two.Matrix } [output ] - The optional matrix to apply the inversion to.
345
346
* @description Return an inverted version of the matrix. If no optional one is passed a new matrix is created and returned.
346
347
*/
347
- inverse ( out ) {
348
+ inverse ( output ) {
348
349
const a = this . elements ;
349
- out = out || new Matrix ( ) ;
350
+ output = output || new Matrix ( ) ;
350
351
351
352
const a00 = a [ 0 ] ,
352
353
a01 = a [ 1 ] ,
@@ -371,23 +372,23 @@ export class Matrix extends Events {
371
372
372
373
det = 1.0 / det ;
373
374
374
- out . elements [ 0 ] = b01 * det ;
375
- out . elements [ 1 ] = ( - a22 * a01 + a02 * a21 ) * det ;
376
- out . elements [ 2 ] = ( a12 * a01 - a02 * a11 ) * det ;
377
- out . elements [ 3 ] = b11 * det ;
378
- out . elements [ 4 ] = ( a22 * a00 - a02 * a20 ) * det ;
379
- out . elements [ 5 ] = ( - a12 * a00 + a02 * a10 ) * det ;
380
- out . elements [ 6 ] = b21 * det ;
381
- out . elements [ 7 ] = ( - a21 * a00 + a01 * a20 ) * det ;
382
- out . elements [ 8 ] = ( a11 * a00 - a01 * a10 ) * det ;
383
-
384
- return out ;
375
+ output . elements [ 0 ] = b01 * det ;
376
+ output . elements [ 1 ] = ( - a22 * a01 + a02 * a21 ) * det ;
377
+ output . elements [ 2 ] = ( a12 * a01 - a02 * a11 ) * det ;
378
+ output . elements [ 3 ] = b11 * det ;
379
+ output . elements [ 4 ] = ( a22 * a00 - a02 * a20 ) * det ;
380
+ output . elements [ 5 ] = ( - a12 * a00 + a02 * a10 ) * det ;
381
+ output . elements [ 6 ] = b21 * det ;
382
+ output . elements [ 7 ] = ( - a21 * a00 + a01 * a20 ) * det ;
383
+ output . elements [ 8 ] = ( a11 * a00 - a01 * a10 ) * det ;
384
+
385
+ return output ;
385
386
}
386
387
387
388
/**
388
389
* @name Two.Matrix#scale
389
390
* @function
390
- * @param {Number } scale - The one dimensional scale to apply to the matrix.
391
+ * @param {Number } s - The one dimensional scale to apply to the matrix.
391
392
* @description Uniformly scale the transformation matrix.
392
393
*/
393
394
@@ -410,22 +411,22 @@ export class Matrix extends Events {
410
411
/**
411
412
* @name Two.Matrix#rotate
412
413
* @function
413
- * @param {Number } Number - The amount to rotate in Number.
414
+ * @param {Number } n - The amount to rotate in Number.
414
415
* @description Rotate the matrix.
415
416
*/
416
- rotate ( Number ) {
417
- const c = cos ( Number ) ;
418
- const s = sin ( Number ) ;
417
+ rotate ( n ) {
418
+ const c = cos ( n ) ;
419
+ const s = sin ( n ) ;
419
420
420
421
return this . multiply ( c , - s , 0 , s , c , 0 , 0 , 0 , 1 ) ;
421
422
}
422
423
423
424
/**
424
425
* @name Two.Matrix#translate
425
426
* @function
426
- * @param {Number } x - The horizontal translation value to apply.
427
- * @param {Number } y - The vertical translation value to apply.
428
- * @description Translate the matrix.
427
+ * @param {Number } x - The horizontal translation value to apply
428
+ * @param {Number } y - The vertical translation value to apply
429
+ * @description Translate the matrix to specific `x` / `y` values .
429
430
*/
430
431
translate ( x , y ) {
431
432
return this . multiply ( 1 , 0 , x , 0 , 1 , y , 0 , 0 , 1 ) ;
@@ -434,23 +435,23 @@ export class Matrix extends Events {
434
435
/**
435
436
* @name Two.Matrix#skewX
436
437
* @function
437
- * @param {Number } Number - The amount to skew in Number.
438
+ * @param {Number } n - The amount to skew
438
439
* @description Skew the matrix by an angle in the x axis direction.
439
440
*/
440
- skewX ( Number ) {
441
- const a = tan ( Number ) ;
441
+ skewX ( n ) {
442
+ const a = tan ( n ) ;
442
443
443
444
return this . multiply ( 1 , a , 0 , 0 , 1 , 0 , 0 , 0 , 1 ) ;
444
445
}
445
446
446
447
/**
447
448
* @name Two.Matrix#skewY
448
449
* @function
449
- * @param {Number } Number - The amount to skew in Number.
450
+ * @param {Number } n - The amount to skew
450
451
* @description Skew the matrix by an angle in the y axis direction.
451
452
*/
452
- skewY ( Number ) {
453
- const a = tan ( Number ) ;
453
+ skewY ( n ) {
454
+ const a = tan ( n ) ;
454
455
455
456
return this . multiply ( 1 , 0 , 0 , a , 1 , 0 , 0 , 0 , 1 ) ;
456
457
}
0 commit comments