pub struct Gamma(pub f32);
Expand description
The gamma distance represents the actual distance traveled by the component
§Unit
- Can be either radians or millimeters
§Operations
use syunit::{Gamma, Delta};
// Subtract two absolute distances to get once relative
assert_eq!(Gamma(2.0) - Gamma(1.0), Delta(1.0));
// Add relative distance to an absolute one
assert_eq!(Gamma(2.0) + Delta(1.0), Gamma(3.0));
assert_eq!(Gamma(2.0) - Delta(1.0), Gamma(1.0));
Tuple Fields§
§0: f32
Implementations§
source§impl Gamma
impl Gamma
sourcepub const NEG_INFINITY: Self = _
pub const NEG_INFINITY: Self = _
Negative Infinity value of this unit (f32::INFINITY)
sourcepub fn is_normal(self) -> bool
pub fn is_normal(self) -> bool
Returns true
if this units value is neither NaN, Infinite or zero
sourcepub fn is_sign_negative(self) -> bool
pub fn is_sign_negative(self) -> bool
Returns true
if the sign bit of this value is negative (value smaller than 0.0, -0.0 included)
sourcepub fn is_sign_positive(self) -> bool
pub fn is_sign_positive(self) -> bool
Returns true
if the sign bit of this value is positive (value smaller than 0.0, -0.0 included)
sourcepub fn max_ref<'a>(&'a self, other: &'a Self) -> &'a Self
pub fn max_ref<'a>(&'a self, other: &'a Self) -> &'a Self
Return the bigger value of this and another unit, working with references
sourcepub fn min_ref<'a>(&'a self, other: &'a Self) -> &'a Self
pub fn min_ref<'a>(&'a self, other: &'a Self) -> &'a Self
Return the bigger value of this and another unit, working with references
sourcepub fn get_direction(self) -> Direction
pub fn get_direction(self) -> Direction
Get the direction of the value (positive or negative)
0.0
will be accounted as positive
Trait Implementations§
source§impl AddAssign<Delta> for Gamma
impl AddAssign<Delta> for Gamma
source§fn add_assign(&mut self, rhs: Delta)
fn add_assign(&mut self, rhs: Delta)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Gamma
impl<'de> Deserialize<'de> for Gamma
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 for Gamma
impl PartialEq for Gamma
source§impl PartialOrd for Gamma
impl PartialOrd for Gamma
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 moresource§impl SubAssign<Delta> for Gamma
impl SubAssign<Delta> for Gamma
source§fn sub_assign(&mut self, rhs: Delta)
fn sub_assign(&mut self, rhs: Delta)
Performs the
-=
operation. Read moreimpl Copy for Gamma
impl StructuralPartialEq for Gamma
Auto Trait Implementations§
impl Freeze for Gamma
impl RefUnwindSafe for Gamma
impl Send for Gamma
impl Sync for Gamma
impl Unpin for Gamma
impl UnwindSafe for Gamma
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