cross {globe} | R Documentation |
Computes the cross-product of two vectors in 3D.
cross(a, b)
a , b |
Numeric vectors of length 3. |
Computes the cross product of the two vectors.
A vector of length 3 representing the cross product. If the input vectors have length greater than 3, only the first 3 elements will be used in this calculation.
Adrian Baddeley and Tom Lawrence
a <- c(1,0,0)
b <- c(0,1,0)
cross(a, b)