Utils.CrossProduct: Cross Product of two direction vectors in 3D space

Description Usage Arguments Value References See Also Examples

Description

Cross Product of two direction vectors in 3D space

Usage

1

Arguments

a

First direction vector

b

Second direction vector

Value

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

References

https://en.wikipedia.org/wiki/Cross_product

See Also

Other utils: Utils.DotProduct, Utils.UnitVector, Utils.VectorLength

Examples

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

JerBoon/vecspace documentation built on May 26, 2019, 7:28 a.m.