pub trait Orientation {
type Rotation;
// Required methods
fn orientation(&self) -> &Self::Rotation;
fn orientation_mut(&mut self) -> &mut Self::Rotation;
}Expand description
The orientation of a site or body: $\theta$ or $\mathbf{q}$.
When applied to site properties, Orientation has a context-dependent definition.
- Elements in
Microstate::sitesdescribe the rotation from the site’s local frame to the system frame. - Elements in
Body::sitesdescribe the rotation from the site’s local frame to the body frame.
When applied to body properties, Orientation describes the rotation from
the body frame to the system frame.
§Units
The units of Orientation depend on the representation chosen for Rotation.
For example, hoomd_vector::Angle has units of radians while
hoomd_vector::Versor is unitless.
§Derive macro
Use the Orientation derive macro to automatically implement
the Orientation trait on a type. The type must have a field named orientation.
use hoomd_microstate::property::Orientation;
use hoomd_vector::Versor;
#[derive(Orientation)]
struct Custom {
orientation: Versor,
}Required Associated Types§
Required Methods§
Sourcefn orientation(&self) -> &Self::Rotation
fn orientation(&self) -> &Self::Rotation
The orientation of this site or body.
Sourcefn orientation_mut(&mut self) -> &mut Self::Rotation
fn orientation_mut(&mut self) -> &mut Self::Rotation
The orientation of this site or body (mutable).