pub struct Force { /* private fields */ }
Expand description
The Force
struct can be used to deal with force in a common way.
#Example
use measurements::Force;
use measurements::Mass;
use measurements::Acceleration;
let metric_ton = Mass::from_metric_tons(1.0);
let gravity = Acceleration::from_meters_per_second_per_second(9.81);
let force: Force = metric_ton * gravity; // F=ma
println!(
"One metric ton exerts a force of {} due to gravity",
force);
Implementations§
Source§impl Force
impl Force
Sourcepub fn from_newtons(newtons: f64) -> Self
pub fn from_newtons(newtons: f64) -> Self
Create a Force from a floating point value in Newtons
Sourcepub fn from_micronewtons(micronewtons: f64) -> Self
pub fn from_micronewtons(micronewtons: f64) -> Self
Create a Force from a floating point value in Micronewtons
Sourcepub fn from_millinewtons(millinewtons: f64) -> Self
pub fn from_millinewtons(millinewtons: f64) -> Self
Create a Force from a floating point value in Millinewtons
Sourcepub fn from_pounds(pounds: f64) -> Self
pub fn from_pounds(pounds: f64) -> Self
Create a Force from a floating point value in pounds
Sourcepub fn from_poundals(poundals: f64) -> Self
pub fn from_poundals(poundals: f64) -> Self
Create a Force from a floating point value in poundals
Sourcepub fn from_kiloponds(kiloponds: f64) -> Self
pub fn from_kiloponds(kiloponds: f64) -> Self
Create a Force from a floating point value in kiloponds
Sourcepub fn from_dynes(dynes: f64) -> Self
pub fn from_dynes(dynes: f64) -> Self
Create a Force from a floating point value in Dynes
Sourcepub fn as_micronewtons(&self) -> f64
pub fn as_micronewtons(&self) -> f64
Convert this Force into a floating point value in Micronewtons
Sourcepub fn as_millinewtons(&self) -> f64
pub fn as_millinewtons(&self) -> f64
Convert this Force into a floating point value in Milliewtons
Sourcepub fn as_newtons(&self) -> f64
pub fn as_newtons(&self) -> f64
Convert this Force into a floating point value in Newtons
Sourcepub fn as_pounds(&self) -> f64
pub fn as_pounds(&self) -> f64
Convert this Force into a floating point value in pound-force (lb.f)
Sourcepub fn as_poundals(&self) -> f64
pub fn as_poundals(&self) -> f64
Convert this Force into a floating point value in poundals
Sourcepub fn as_kiloponds(&self) -> f64
pub fn as_kiloponds(&self) -> f64
Convert this Force into a floating point value in kiloponds