pub trait Wedge {
type Bivector;
// Required method
fn wedge(&self, other: &Self) -> Self::Bivector;
}Expand description
The vector wedge product.
The result of a vector wedge product is a bivector. Mathematically, bivectors are different from vectors. In practice, hoomd-rs uses follows standard physics practices, where torques are bivectors:
- When the inputs are 2D vectors (
Cartesian<2>), the result is a scalar. - When the inputs are 3D vectors (
Cartesian<3>), the result is anotherCartesian<3>.
Required Associated Types§
Required Methods§
Sourcefn wedge(&self, other: &Self) -> Self::Bivector
fn wedge(&self, other: &Self) -> Self::Bivector
Compute the wedge product of two vectors.
\textbf{A}=\textbf{a}\wedge{\textbf{b}}§Examples
2D:
use hoomd_vector::{Cartesian, Wedge};
let a = Cartesian::from([2.0, 1.0]);
let b = Cartesian::from([3.0, 1.0]);
assert_eq!(a.wedge(&b), -1.0);3D:
use hoomd_vector::{Cartesian, Wedge};
let a = Cartesian::from([1.0, 0.0, 0.0]);
let b = Cartesian::from([0.0, 1.0, 0.0]);
assert_eq!(a.wedge(&b), [0.0, 0.0, 1.0].into());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.