modeling/src/maths/vec3/add.js

  1. /**
  2. * Adds the coordinates of two vectors (A+B).
  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.add
  9. */
  10. const add = (out, a, b) => {
  11. out[0] = a[0] + b[0]
  12. out[1] = a[1] + b[1]
  13. out[2] = a[2] + b[2]
  14. return out
  15. }
  16. module.exports = add