MCPcopy Create free account
hub / github.com/esengine/esengine / multiplyMatrices

Function multiplyMatrices

scripts/compare-ibm.mjs:295–307  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

293
294// Verify by checking M * M^-1 = I
295function multiplyMatrices(a, b) {
296 const result = new Float32Array(16);
297 for (let row = 0; row < 4; row++) {
298 for (let col = 0; col < 4; col++) {
299 let sum = 0;
300 for (let k = 0; k < 4; k++) {
301 sum += a[row + k * 4] * b[k + col * 4];
302 }
303 result[row + col * 4] = sum;
304 }
305 }
306 return result;
307}
308
309console.log('\n=== VERIFICATION: TransformLink * IBM should = Identity ===');
310const verify1 = multiplyMatrices(tlColMajor, ibmCorrect);

Callers 1

compare-ibm.mjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected