MCPcopy Index your code
hub / github.com/jabbany/CommentCoreLibrary / dotProduct

Method dotProduct

src/scripting/api/Display/Matrix.ts:83–96  ·  view source on GitHub ↗
(o:Array<number>)

Source from the content-addressed store, hash-verified

81 }
82
83 private dotProduct(o:Array<number>):Array<number> {
84 if (o.length < 9) {
85 throw new Error('Matrix dot product expects a 3x3 Matrix');
86 }
87 var res:Array<number> = [0, 0, 0, 0, 0, 0, 0, 0, 0];
88 for (var i = 0; i < 3; i++) {
89 for (var j = 0; j < 3; j++) {
90 for (var k = 0; k < 3; k++) {
91 res[i * 3 + j] += this._data[i * 3 + k] * o[k * 3 + j];
92 }
93 }
94 }
95 return res;
96 }
97
98 public setTo(a:number = 1, b:number = 0, c:number = 0, d:number = 1, tx:number = 0, ty:number = 0):void {
99 this._data = [a, c, tx, b, d, ty, 0, 0, 1];

Callers 2

rotateMethod · 0.95
scaleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected