Struct measurements::angular_velocity::AngularVelocity
source · [−]pub struct AngularVelocity { /* private fields */ }
Expand description
The ‘AngularVelocity’ struct can be used to deal with angular velocities in a common way.
Example
use measurements::AngularVelocity;
const cylinders: f64 = 6.0;
let engine_speed = AngularVelocity::from_rpm(9000.0);
let sparks_per_second = (engine_speed.as_hertz() / 2.0) * cylinders;
Implementations
sourceimpl AngularVelocity
impl AngularVelocity
sourcepub fn from_radians_per_second(radians_per_second: f64) -> Self
pub fn from_radians_per_second(radians_per_second: f64) -> Self
Create a new AngularVelocity from a floating point value in radians per second
sourcepub fn from_rpm(rpm: f64) -> Self
pub fn from_rpm(rpm: f64) -> Self
Create a new AngularVelocity from a floating point value in revolutions per minute (RPM)
sourcepub fn from_hertz(hz: f64) -> Self
pub fn from_hertz(hz: f64) -> Self
Create a new AngularVelocity from a floating point value in revolutions per second (Hz)
sourcepub fn as_radians_per_second(&self) -> f64
pub fn as_radians_per_second(&self) -> f64
Convert this AngularVelocity to a floating point value in radians per second
Trait Implementations
sourceimpl Add<AngularVelocity> for AngularVelocity
impl Add<AngularVelocity> for AngularVelocity
sourceimpl Clone for AngularVelocity
impl Clone for AngularVelocity
sourcefn clone(&self) -> AngularVelocity
fn clone(&self) -> AngularVelocity
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AngularVelocity
impl Debug for AngularVelocity
sourceimpl Display for AngularVelocity
impl Display for AngularVelocity
sourceimpl Div<AngularVelocity> for AngularVelocity
impl Div<AngularVelocity> for AngularVelocity
sourceimpl Div<AngularVelocity> for Power
impl Div<AngularVelocity> for Power
sourceimpl Div<f64> for AngularVelocity
impl Div<f64> for AngularVelocity
sourceimpl Measurement for AngularVelocity
impl Measurement for AngularVelocity
sourcefn as_base_units(&self) -> f64
fn as_base_units(&self) -> f64
Get this quantity in the base units
sourcefn from_base_units(units: f64) -> Self
fn from_base_units(units: f64) -> Self
Create a new quantity from the base units
sourcefn get_base_units_name(&self) -> &'static str
fn get_base_units_name(&self) -> &'static str
Return the base unit for this type, as a string. For example “kilograms” Read more
sourcefn get_appropriate_units(&self) -> (&'static str, f64)
fn get_appropriate_units(&self) -> (&'static str, f64)
Returns a string containing the most appropriate units for this quantity, and a floating point value representing this quantity in those units. Useful when, for example, a length might be in millimeters if it is very small, or kilometers when it is very large. Read more
sourceimpl Mul<AngularVelocity> for f64
impl Mul<AngularVelocity> for f64
type Output = AngularVelocity
type Output = AngularVelocity
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: AngularVelocity) -> AngularVelocity
fn mul(self, rhs: AngularVelocity) -> AngularVelocity
Performs the *
operation. Read more
sourceimpl Mul<AngularVelocity> for Torque
impl Mul<AngularVelocity> for Torque
sourceimpl Mul<Torque> for AngularVelocity
impl Mul<Torque> for AngularVelocity
sourceimpl Mul<f64> for AngularVelocity
impl Mul<f64> for AngularVelocity
sourceimpl PartialEq<AngularVelocity> for AngularVelocity
impl PartialEq<AngularVelocity> for AngularVelocity
sourceimpl PartialOrd<AngularVelocity> for AngularVelocity
impl PartialOrd<AngularVelocity> for AngularVelocity
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Sub<AngularVelocity> for AngularVelocity
impl Sub<AngularVelocity> for AngularVelocity
impl Copy for AngularVelocity
impl Eq for AngularVelocity
Auto Trait Implementations
impl RefUnwindSafe for AngularVelocity
impl Send for AngularVelocity
impl Sync for AngularVelocity
impl Unpin for AngularVelocity
impl UnwindSafe for AngularVelocity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more