pub struct TorqueSystem {
pub torques: Vec<f64>,
}Expand description
A collection of torque values that can be analyzed as a system.
Fields§
§torques: Vec<f64>Torque values in newton-meters.
Implementations§
Source§impl TorqueSystem
impl TorqueSystem
Sourcepub fn new(torques: Vec<f64>) -> Option<Self>
pub fn new(torques: Vec<f64>) -> Option<Self>
Creates a torque system from finite torque values.
Returns None when any torque is not finite.
Sourcepub fn net_torque(&self) -> Option<f64>
pub fn net_torque(&self) -> Option<f64>
Computes the system’s net torque.
§Examples
use use_torque::TorqueSystem;
let system = TorqueSystem::new(vec![10.0, -4.0, 2.0]).unwrap();
assert_eq!(system.net_torque(), Some(8.0));Sourcepub fn is_equilibrium(&self, tolerance: f64) -> Option<bool>
pub fn is_equilibrium(&self, tolerance: f64) -> Option<bool>
Checks whether the system is in rotational equilibrium for the provided tolerance.
Trait Implementations§
Source§impl Clone for TorqueSystem
impl Clone for TorqueSystem
Source§fn clone(&self) -> TorqueSystem
fn clone(&self) -> TorqueSystem
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 TorqueSystem
impl Debug for TorqueSystem
Source§impl PartialEq for TorqueSystem
impl PartialEq for TorqueSystem
Source§fn eq(&self, other: &TorqueSystem) -> bool
fn eq(&self, other: &TorqueSystem) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TorqueSystem
Auto Trait Implementations§
impl Freeze for TorqueSystem
impl RefUnwindSafe for TorqueSystem
impl Send for TorqueSystem
impl Sync for TorqueSystem
impl Unpin for TorqueSystem
impl UnsafeUnpin for TorqueSystem
impl UnwindSafe for TorqueSystem
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