Struct LeverForce
pub struct LeverForce {
pub force: f64,
pub lever_arm: f64,
}Expand description
A force applied at a lever arm.
Fields§
§force: f64Applied force in newtons.
lever_arm: f64Lever arm in meters.
Implementations§
§impl LeverForce
impl LeverForce
pub const fn new(force: f64, lever_arm: f64) -> Option<LeverForce>
pub const fn new(force: f64, lever_arm: f64) -> Option<LeverForce>
Creates a lever-force pair from finite values.
Returns None when either input is not finite.
pub fn torque(&self) -> Option<f64>
pub fn torque(&self) -> Option<f64>
Computes torque for this force and lever arm.
§Examples
use use_torque::LeverForce;
let lever = LeverForce::new(10.0, 2.0).unwrap();
assert_eq!(lever.torque(), Some(20.0));pub fn torque_at_angle(&self, angle_radians: f64) -> Option<f64>
pub fn torque_at_angle(&self, angle_radians: f64) -> Option<f64>
Computes torque for this force and lever arm at an angle in radians.
Trait Implementations§
§impl Clone for LeverForce
impl Clone for LeverForce
§fn clone(&self) -> LeverForce
fn clone(&self) -> LeverForce
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for LeverForce
impl Debug for LeverForce
§impl PartialEq for LeverForce
impl PartialEq for LeverForce
impl Copy for LeverForce
impl StructuralPartialEq for LeverForce
Auto Trait Implementations§
impl Freeze for LeverForce
impl RefUnwindSafe for LeverForce
impl Send for LeverForce
impl Sync for LeverForce
impl Unpin for LeverForce
impl UnsafeUnpin for LeverForce
impl UnwindSafe for LeverForce
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