pub fn cross_product<T, const N: usize>(
u: &Vector<T, N>,
v: &Vector<T, N>,
) -> Vector<T, 3>
Expand description
Computes the cross product of two 3-dimensional vectors.
The cross product u × v is defined for 3D vectors as: u × v = [u2v3 - u3v2, u3v1 - u1v3, u1v2 - u2v1]
§Arguments
u
- A reference to the first 3D vectorv
- A reference to the second 3D vector
§Returns
A new Vector<T, 3>
representing the cross product of u
and v
.
§Type Parameters
T
- The floating-point type of the vector componentsN
- The dimensionality of the vectors (should be 3)
§Panics
This function will panic if the input vectors are not 3-dimensional.