rhb-server/mes-ui/rhb-app/node_modules/gl-vec2/transformMat3.js

18 lines
439 B
JavaScript
Raw Normal View History

2025-10-20 11:14:41 +08:00
module.exports = transformMat3
/**
* Transforms the vec2 with a mat3
* 3rd vector component is implicitly '1'
*
* @param {vec2} out the receiving vector
* @param {vec2} a the vector to transform
* @param {mat3} m matrix to transform with
* @returns {vec2} out
*/
function transformMat3(out, a, m) {
var x = a[0],
y = a[1]
out[0] = m[0] * x + m[3] * y + m[6]
out[1] = m[1] * x + m[4] * y + m[7]
return out
}