rhb-server/mes-ui/rhb-app/node_modules/gl-mat2/multiply.js
2025-10-20 11:14:41 +08:00

21 lines
487 B
JavaScript

module.exports = multiply
/**
* Multiplies two mat2's
*
* @alias mat2.multiply
* @param {mat2} out the receiving matrix
* @param {mat2} a the first operand
* @param {mat2} b the second operand
* @returns {mat2} out
*/
function multiply(out, a, b) {
var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]
var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]
out[0] = a0 * b0 + a2 * b1
out[1] = a1 * b0 + a3 * b1
out[2] = a0 * b2 + a2 * b3
out[3] = a1 * b2 + a3 * b3
return out
}