src/v3.js
function cross(a, b, dst) {
  dst = dst || new VecType(3);

  const t1 = a[2] * b[0] - a[0] * b[2];
  const t2 = a[0] * b[1] - a[1] * b[0];
  dst[0] = a[1] * b[2] - a[2] * b[1];
  dst[1] = t1;
  dst[2] = t2;

  return dst;
}
function cross(a, b, dst) {
  dst = dst || new VecType(3);

  const t1 = a[2] * b[0] - a[0] * b[2];
  const t2 = a[0] * b[1] - a[1] * b[0];
  dst[0] = a[1] * b[2] - a[2] * b[1];
  dst[1] = t1;
  dst[2] = t2;

  return dst;
}
function cross ( a , b , dst ) { dst = dst || new VecType ( 3 ) ; const t1 = a [ 2 ] * b [ 0 ] - a [ 0 ] * b [ 2 ] ; const t2 = a [ 0 ] * b [ 1 ] - a [ 1 ] * b [ 0 ] ; dst [ 0 ] = a [ 1 ] * b [ 2 ] - a [ 2 ] * b [ 1 ] ; dst [ 1 ] = t1 ; dst [ 2 ] = t2 ; return dst ; }
Computes the cross product of two vectors; assumes both vectors have
three entries.
@param {module:twgl/v3.Vec3} a Operand vector.
@param {module:twgl/v3.Vec3} b Operand vector.
@param {module:twgl/v3.Vec3} [dst] vector to hold result. If not new one is created..
@return {module:twgl/v3.Vec3} The vector a cross b.
@memberOf module:twgl/v3
Computes the cross product of two vectors ; assumes both vectors have three entries .