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

21 lines
374 B
JavaScript

module.exports = adjoint
/**
* Calculates the adjugate of a mat2
*
* @alias mat2.adjoint
* @param {mat2} out the receiving matrix
* @param {mat2} a the source matrix
* @returns {mat2} out
*/
function adjoint(out, a) {
// Caching this value is nessecary if out == a
var a0 = a[0]
out[0] = a[3]
out[1] = -a[1]
out[2] = -a[2]
out[3] = a0
return out
}