pub struct UnitCell { /* private fields */ }
Expand description
A unit cell of a crystal, containing its dimensions and angles
Implementations§
source§impl UnitCell
impl UnitCell
sourcepub const fn new(
a: f64,
b: f64,
c: f64,
alpha: f64,
beta: f64,
gamma: f64
) -> Self
pub const fn new( a: f64, b: f64, c: f64, alpha: f64, beta: f64, gamma: f64 ) -> Self
Create a new UnitCell
construct.
Arguments
a
- a-axis dimensionb
- b-axis dimensionc
- c-axis dimensionalpha
- alpha angle in degreesbeta
- beta angle in degreesgamma
- gamma angle in degrees
sourcepub fn set_alpha(&mut self, new_alpha: f64)
pub fn set_alpha(&mut self, new_alpha: f64)
Set the alpha angle in degrees
Panics
It panics if the new value is not finite. It also panics if the alpha value is outside of bounds [0, 360)
sourcepub fn set_beta(&mut self, new_beta: f64)
pub fn set_beta(&mut self, new_beta: f64)
Set the beta angle in degrees
Panics
It panics if the new value is not finite. It also panics if the beta value is outside of bounds [0, 360)
Trait Implementations§
source§impl<'de> Deserialize<'de> for UnitCell
impl<'de> Deserialize<'de> for UnitCell
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 PartialEq<UnitCell> for UnitCell
impl PartialEq<UnitCell> for UnitCell
source§impl PartialOrd<UnitCell> for UnitCell
impl PartialOrd<UnitCell> for UnitCell
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for UnitCell
Auto Trait Implementations§
impl RefUnwindSafe for UnitCell
impl Send for UnitCell
impl Sync for UnitCell
impl Unpin for UnitCell
impl UnwindSafe for UnitCell
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