Skip to content

format

typescript
Vector3.Cross(lhs, rhs)

class: Vector3

description

Calculates the cross product of two vectors.

This method returns a new vector that is perpendicular to the original vectors and has a length equal to the area of the parallelogram formed by the original vectors.

parameter

param_nametypedescription
lhsVector3The first vector participating in the cross product.
rhsVector3The second vector participating in the cross product.

return

typedescription
Vector3The result of the cross product.

code example

typescript
let from = new Vector3(1,2,3);
let to = new Vector3(3,4,5);
Debug.Log("Cross is",Vector3.Cross(from,to));