cross function

List<double> cross(
  1. dynamic out,
  2. dynamic a,
  3. dynamic b
)

Computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector

@param {vec3} out the receiving vector @param {ReadonlyVec2} a the first operand @param {ReadonlyVec2} b the second operand @returns {vec3} out

Implementation

List<double> cross(out, a, b) {
  var z = a[0] * b[1] - a[1] * b[0];
  out[0] = out[1] = 0;
  out[2] = z;
  return out;
}