pub struct OrientedPoint<V, R> {
pub position: V,
pub orientation: R,
}Expand description
The position and orientation of an extended body.
Use OrientedPoint as a Body or Site property type.
§Example
use hoomd_microstate::property::OrientedPoint;
use hoomd_vector::{Angle, Cartesian};
let point = OrientedPoint {
position: Cartesian::from([1.0, -3.0]),
orientation: Angle::from(1.2),
};Fields§
§position: VThe location of the extended body in space.
orientation: RRotate from the body’s reference frame into another frame.
Trait Implementations§
Source§impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<2>, Angle>, X, Closed<Hypercuboid<2>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<2>, Angle>, X, Closed<Hypercuboid<2>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, OrientedPoint<Cartesian<2>, Angle>, X, Closed<Hypercuboid<2>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, OrientedPoint<Cartesian<2>, Angle>, X, Closed<Hypercuboid<2>>>, ) -> Result<Frame<'_>, AppendError>
Append the contents of the microstate as a frame in a GSD file. Read more
Source§impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<2>, Angle>, X, Periodic<Hypercuboid<2>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<2>, Angle>, X, Periodic<Hypercuboid<2>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, OrientedPoint<Cartesian<2>, Angle>, X, Periodic<Hypercuboid<2>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, OrientedPoint<Cartesian<2>, Angle>, X, Periodic<Hypercuboid<2>>>, ) -> Result<Frame<'_>, AppendError>
Append the contents of the microstate as a frame in a GSD file. Read more
Source§impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<3>, Versor>, X, Closed<Hypercuboid<3>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<3>, Versor>, X, Closed<Hypercuboid<3>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, OrientedPoint<Cartesian<3>, Versor>, X, Closed<Hypercuboid<3>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, OrientedPoint<Cartesian<3>, Versor>, X, Closed<Hypercuboid<3>>>, ) -> Result<Frame<'_>, AppendError>
Append the contents of the microstate as a frame in a GSD file. Read more
Source§impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<3>, Versor>, X, Periodic<Hypercuboid<3>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, OrientedPoint<Cartesian<3>, Versor>, X, Periodic<Hypercuboid<3>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, OrientedPoint<Cartesian<3>, Versor>, X, Periodic<Hypercuboid<3>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, OrientedPoint<Cartesian<3>, Versor>, X, Periodic<Hypercuboid<3>>>, ) -> Result<Frame<'_>, AppendError>
Append the contents of the microstate as a frame in a GSD file. Read more
Source§impl<V: Clone, R: Clone> Clone for OrientedPoint<V, R>
impl<V: Clone, R: Clone> Clone for OrientedPoint<V, R>
Source§fn clone(&self) -> OrientedPoint<V, R>
fn clone(&self) -> OrientedPoint<V, R>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Default, R: Default> Default for OrientedPoint<V, R>
impl<V: Default, R: Default> Default for OrientedPoint<V, R>
Source§fn default() -> OrientedPoint<V, R>
fn default() -> OrientedPoint<V, R>
Returns the “default value” for a type. Read more
Source§impl<'de, V, R> Deserialize<'de> for OrientedPoint<V, R>where
V: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, V, R> Deserialize<'de> for OrientedPoint<V, R>where
V: Deserialize<'de>,
R: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<V, R> Orientation for OrientedPoint<V, R>
impl<V, R> Orientation for OrientedPoint<V, R>
Source§impl<P, R> Position for OrientedPoint<P, R>
impl<P, R> Position for OrientedPoint<P, R>
Source§impl<V, R> Serialize for OrientedPoint<V, R>
impl<V, R> Serialize for OrientedPoint<V, R>
Source§impl<V, R> Transform<OrientedPoint<V, R>> for OrientedPoint<V, R>
Treat OrientedPoint sites as constituents of oriented rigid bodies.
impl<V, R> Transform<OrientedPoint<V, R>> for OrientedPoint<V, R>
Treat OrientedPoint sites as constituents of oriented rigid bodies.
Source§fn transform(
&self,
site_properties: &OrientedPoint<V, R>,
) -> OrientedPoint<V, R>
fn transform( &self, site_properties: &OrientedPoint<V, R>, ) -> OrientedPoint<V, R>
Move Point properties from the local body frame to the system frame.
\vec{r} = \vec{r}_\mathrm{body} + R_\mathrm{body}(\vec{r}_\mathrm{site})R = R_\mathrm{body}(R_\mathrm{site})use approxim::assert_relative_eq;
use hoomd_microstate::{Transform, property::OrientedPoint};
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;
let body_properties = OrientedPoint {
position: Cartesian::from([1.0, -2.0]),
orientation: Angle::from(PI / 2.0),
};
let site_properties = OrientedPoint {
position: Cartesian::from([-1.0, 0.0]),
orientation: Angle::from(PI / 4.0),
};
let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [1.0, -3.0].into());
assert_relative_eq!(system_site.orientation.theta, 3.0 * PI / 4.0);Source§impl<V, R> Transform<Point<V>> for OrientedPoint<V, R>
Treat Point sites as constituents of oriented rigid bodies.
impl<V, R> Transform<Point<V>> for OrientedPoint<V, R>
Treat Point sites as constituents of oriented rigid bodies.
Source§fn transform(&self, site_properties: &Point<V>) -> Point<V>
fn transform(&self, site_properties: &Point<V>) -> Point<V>
Move Point properties from the local body frame to the system frame.
\vec{r} = \vec{r}_\mathrm{body} + R_\mathrm{body}(\vec{r}_\mathrm{site})use approxim::assert_relative_eq;
use hoomd_microstate::{
Transform,
property::{OrientedPoint, Point},
};
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;
let body_properties = OrientedPoint {
position: Cartesian::from([1.0, -2.0]),
orientation: Angle::from(PI / 2.0),
};
let site_properties = Point::new(Cartesian::from([-1.0, 0.0]));
let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [1.0, -3.0].into());impl<V: Copy, R: Copy> Copy for OrientedPoint<V, R>
impl<V, R> StructuralPartialEq for OrientedPoint<V, R>
Auto Trait Implementations§
impl<V, R> Freeze for OrientedPoint<V, R>
impl<V, R> RefUnwindSafe for OrientedPoint<V, R>where
V: RefUnwindSafe,
R: RefUnwindSafe,
impl<V, R> Send for OrientedPoint<V, R>
impl<V, R> Sync for OrientedPoint<V, R>
impl<V, R> Unpin for OrientedPoint<V, R>
impl<V, R> UnwindSafe for OrientedPoint<V, R>where
V: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more