Description Usage Arguments Value References See Also Examples
Cross Product of two direction vectors in 3D space
1 | Utils.CrossProduct(a, b)
|
a |
First direction vector |
b |
Second direction vector |
Three element vector which is perpentical to the plane containing the two input vectors. Returns c(0,0,0) is the two inputs are parallel or if either are zero length.
Note: Utils.CrossProduct(a, b) == - Utils.CrossProduct(b, a)
This function is specifically coded for 3D space, i.e. totally expects both a and b to be 3 element vectors
https://en.wikipedia.org/wiki/Cross_product
Other utils: Utils.DotProduct
,
Utils.UnitVector
,
Utils.VectorLength
1 2 | Utils.CrossProduct(c(3,2,1),c(1,2,3)) # [1] 4 -8 4
Utils.CrossProduct(c(1,1,1),c(2,2,2)) # [1] 0 0 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.