vec_cross (VECTOR* vector, VECTOR* vector1, VECTOR* vector2);

Sets vector to the cross product of vector1 and vector2. The cross product is a vector perpendicular to both vector1 and vector2, with a magnitude equivalent to the area of the parallelogram that the two vectors span.

Parameters:

vector1 - first vector.
vector2 - second vector.

Returns:

vector

Modifies:

vector = vector1 x vector2

Speed:

Fast

Example:

var a[3];
var b[3] = { 1,0,0 };
var c[3] = { 0,1,0 }; vec_cross(a,b,c); // sets a to { 0,0,1 }

See also:

Vectors, vec_add, vec_sub, vec_scale, vec_set, vec_inverse, vec_diff, vec_dot

► latest version online