15 lines
275 B
JavaScript
15 lines
275 B
JavaScript
module.exports = inverse
|
|
|
|
/**
|
|
* Returns the inverse of the components of a vec2
|
|
*
|
|
* @param {vec2} out the receiving vector
|
|
* @param {vec2} a vector to invert
|
|
* @returns {vec2} out
|
|
*/
|
|
function inverse(out, a) {
|
|
out[0] = 1.0 / a[0]
|
|
out[1] = 1.0 / a[1]
|
|
return out
|
|
}
|