modeling/src/maths/vec3/dot.js

  1. /**
  2. * Calculates the dot product of two vectors.
  3. *
  4. * @param {vec3} a - first operand
  5. * @param {vec3} b - second operand
  6. * @returns {Number} dot product
  7. * @alias module:modeling/maths/vec3.dot
  8. */
  9. const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
  10. module.exports = dot