pub struct ConstantForceWork {
pub force: f64,
pub displacement: f64,
}Expand description
Constant-force work inputs for repeated calculations.
Fields§
§force: f64§displacement: f64Implementations§
Source§impl ConstantForceWork
impl ConstantForceWork
Sourcepub const fn new(force: f64, displacement: f64) -> Option<Self>
pub const fn new(force: f64, displacement: f64) -> Option<Self>
Creates a constant-force work helper from finite inputs.
Returns None when either input is not finite.
Sourcepub fn work(&self) -> Option<f64>
pub fn work(&self) -> Option<f64>
Computes the work represented by this constant-force relationship.
§Examples
use use_work::ConstantForceWork;
let helper = ConstantForceWork::new(10.0, 2.0).unwrap();
assert_eq!(helper.work(), Some(20.0));Sourcepub fn work_at_angle(&self, angle_radians: f64) -> Option<f64>
pub fn work_at_angle(&self, angle_radians: f64) -> Option<f64>
Computes the work represented by this constant-force relationship at an angle.
Trait Implementations§
Source§impl Clone for ConstantForceWork
impl Clone for ConstantForceWork
Source§fn clone(&self) -> ConstantForceWork
fn clone(&self) -> ConstantForceWork
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstantForceWork
impl Debug for ConstantForceWork
Source§impl PartialEq for ConstantForceWork
impl PartialEq for ConstantForceWork
Source§fn eq(&self, other: &ConstantForceWork) -> bool
fn eq(&self, other: &ConstantForceWork) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ConstantForceWork
impl StructuralPartialEq for ConstantForceWork
Auto Trait Implementations§
impl Freeze for ConstantForceWork
impl RefUnwindSafe for ConstantForceWork
impl Send for ConstantForceWork
impl Sync for ConstantForceWork
impl Unpin for ConstantForceWork
impl UnsafeUnpin for ConstantForceWork
impl UnwindSafe for ConstantForceWork
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