dot function

List<double> dot(
  1. dynamic a,
  2. dynamic b
)

Calculates the dot product of two vec2's

@param {ReadonlyVec2} a the first operand @param {ReadonlyVec2} b the second operand @returns {Number} dot product of a and b

Implementation

List<double> dot(a, b) {
  return a[0] * b[0] + a[1] * b[1];
}