CrossProduct

Trait CrossProduct 

Source
pub trait CrossProduct {
    // Required method
    fn cross(l: &Self, r: &Self) -> Self;
}
Expand description

Trait for computing the cross product of 3D vectors.

The cross product is only defined for 3D vectors and produces a vector perpendicular to both input vectors.

Required Methods§

Source

fn cross(l: &Self, r: &Self) -> Self

Computes the cross product of two vectors.

For 3D vectors v and w:

v × w = (v₂w₃ - v₃w₂, v₃w₁ - v₁w₃, v₁w₂ - v₂w₁)

The resulting vector is perpendicular to both input vectors, with magnitude ||v|| ||w|| sin(θ), where θ is the angle between them.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> CrossProduct for Vector3<T>
where T: Scalar,