vector.cross

Edit

Returns the cross product of two vectors. This is a vector that is perpendicular to both vectors.

cross = vector.cross(a, b)

Arguments

NameTypeDescription
avector The first vector.
bvector The second vector.

Returns

NameTypeDescription
crossvector A vector perpendicular to both a and b.

Notes

If the two input vectors are normalized, the cross product will be normalized as well.

Example

vector.cross(vector(1, 0, 0), vector(0, 1, 0)) --> vector(0, 0, 1)

See also