modeling/src/maths/vec3/min.js

  1. /**
  2. * Returns the minimum coordinates of the given vectors.
  3. *
  4. * @param {vec3} out - receiving vector
  5. * @param {vec3} a - first operand
  6. * @param {vec3} b - second operand
  7. * @returns {vec3} out
  8. * @alias module:modeling/maths/vec3.min
  9. */
  10. const min = (out, a, b) => {
  11. out[0] = Math.min(a[0], b[0])
  12. out[1] = Math.min(a[1], b[1])
  13. out[2] = Math.min(a[2], b[2])
  14. return out
  15. }
  16. module.exports = min