modeling/src/maths/vec3/abs.js

  1. /**
  2. * Calculates the absolute coordinates of the give vector.
  3. *
  4. * @param {vec3} out - receiving vector
  5. * @param {vec3} vector - vector of reference
  6. * @returns {vec3} out
  7. * @alias module:modeling/maths/vec3.abs
  8. */
  9. const abs = (out, vector) => {
  10. out[0] = Math.abs(vector[0])
  11. out[1] = Math.abs(vector[1])
  12. out[2] = Math.abs(vector[2])
  13. return out
  14. }
  15. module.exports = abs