use alga::linear::FiniteDimInnerSpace; use na; /// A 3d cross product that do not require the `Cross` trait impl. /// /// Panics if the dimension of `V` is not 3. #[inline] pub fn cross3(a: &V, b: &V) -> V { assert!(na::dimension::() == 3); let mut res = na::zero::(); res[0] = a[1] * b[2] - a[2] * b[1]; res[1] = a[2] * b[0] - a[0] * b[2]; res[2] = a[0] * b[1] - a[1] * b[0]; res }