pub struct MassSpringSystem {
pub mass_kg: f64,
pub stiffness_nm: f64,
pub damping_ns_m: f64,
}Expand description
A mass-spring-damper system
Fields§
§mass_kg: f64Mass in kilograms
stiffness_nm: f64Stiffness in N/m
damping_ns_m: f64Damping coefficient in N·s/m
Implementations§
Source§impl MassSpringSystem
impl MassSpringSystem
Sourcepub fn with_damping(self, damping_ns_m: f64) -> Self
pub fn with_damping(self, damping_ns_m: f64) -> Self
Add viscous damping to the system
Sourcepub fn is_underdamped(&self) -> bool
pub fn is_underdamped(&self) -> bool
Returns true if the system is underdamped (ζ < 1)
Sourcepub fn is_overdamped(&self) -> bool
pub fn is_overdamped(&self) -> bool
Returns true if the system is overdamped (ζ > 1)
Sourcepub fn is_critically_damped(&self) -> bool
pub fn is_critically_damped(&self) -> bool
Returns true if the system is critically damped (ζ ≈ 1, within 1e-9)
Trait Implementations§
Source§impl Clone for MassSpringSystem
impl Clone for MassSpringSystem
Source§fn clone(&self) -> MassSpringSystem
fn clone(&self) -> MassSpringSystem
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 moreSource§impl Debug for MassSpringSystem
impl Debug for MassSpringSystem
Source§impl PartialEq for MassSpringSystem
impl PartialEq for MassSpringSystem
impl StructuralPartialEq for MassSpringSystem
Auto Trait Implementations§
impl Freeze for MassSpringSystem
impl RefUnwindSafe for MassSpringSystem
impl Send for MassSpringSystem
impl Sync for MassSpringSystem
impl Unpin for MassSpringSystem
impl UnsafeUnpin for MassSpringSystem
impl UnwindSafe for MassSpringSystem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more