17 lines
256 B
JavaScript
17 lines
256 B
JavaScript
module.exports = identity
|
|
|
|
/**
|
|
* Set a mat2 to the identity matrix
|
|
*
|
|
* @alias mat2.identity
|
|
* @param {mat2} out the receiving matrix
|
|
* @returns {mat2} out
|
|
*/
|
|
function identity(out) {
|
|
out[0] = 1
|
|
out[1] = 0
|
|
out[2] = 0
|
|
out[3] = 1
|
|
return out
|
|
}
|