pub struct Velocity(/* private fields */);Expand description
Velocity in meters per second.
Implementations§
Source§impl Velocity
impl Velocity
Sourcepub const fn meters_per_second(mps: f64) -> Self
pub const fn meters_per_second(mps: f64) -> Self
Creates a new velocity from an f64 value in m/s.
Sourcepub const fn kilometers_per_second(mps: f64) -> Self
pub const fn kilometers_per_second(mps: f64) -> Self
Creates a new velocity from an f64 value in km/s.
Sourcepub const fn astronomical_units_per_day(aud: f64) -> Self
pub const fn astronomical_units_per_day(aud: f64) -> Self
Creates a new velocity from an f64 value in au/d.
Sourcepub const fn fraction_of_speed_of_light(c: f64) -> Self
pub const fn fraction_of_speed_of_light(c: f64) -> Self
Creates a new velocity from an f64 value in 1/c.
Sourcepub const fn to_meters_per_second(&self) -> f64
pub const fn to_meters_per_second(&self) -> f64
Returns the value of the velocity in m/s.
Sourcepub const fn to_kilometers_per_second(&self) -> f64
pub const fn to_kilometers_per_second(&self) -> f64
Returns the value of the velocity in km/s.
Sourcepub const fn to_astronomical_units_per_day(&self) -> f64
pub const fn to_astronomical_units_per_day(&self) -> f64
Returns the value of the velocity in au/d.
Sourcepub const fn to_fraction_of_speed_of_light(&self) -> f64
pub const fn to_fraction_of_speed_of_light(&self) -> f64
Returns the value of the velocity in 1/c.
Trait Implementations§
Source§impl AddAssign for Velocity
impl AddAssign for Velocity
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl PartialOrd for Velocity
impl PartialOrd for Velocity
Source§impl SubAssign for Velocity
impl SubAssign for Velocity
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Velocity
impl StructuralPartialEq for Velocity
Auto Trait Implementations§
impl Freeze for Velocity
impl RefUnwindSafe for Velocity
impl Send for Velocity
impl Sync for Velocity
impl Unpin for Velocity
impl UnsafeUnpin for Velocity
impl UnwindSafe for Velocity
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