Skip to main content

Wedge

Trait Wedge 

Source
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:

Required Associated Types§

Source

type Bivector

Type of the bivector result.

Required Methods§

Source

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.

Implementors§