modeling/src/maths/vec4/dot.js

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