pub struct SpringSolver { /* private fields */ }Expand description
Solves the motion of a damped spring: maps a time to the position of a
spring that is released at 0 and settles at 1.
Implementations§
Source§impl SpringSolver
impl SpringSolver
Sourcepub fn from_period(
period_seconds: f64,
zeta: f64,
initial_velocity: f64,
) -> Self
pub fn from_period( period_seconds: f64, zeta: f64, initial_velocity: f64, ) -> Self
Creates a solver from the period of the undamped oscillation in seconds, the damping ratio and the initial velocity.
Sourcepub fn new(m: f64, k: f64, c: f64, initial_velocity: f64) -> Self
pub fn new(m: f64, k: f64, c: f64, initial_velocity: f64) -> Self
Creates a solver from the mass m, the stiffness k, the damping
coefficient c and the initial velocity.
Sourcepub fn from_natural_frequency(wn: f64, zeta: f64, initial_velocity: f64) -> Self
pub fn from_natural_frequency(wn: f64, zeta: f64, initial_velocity: f64) -> Self
Creates a solver from the natural frequency, the damping ratio and the initial velocity.
Trait Implementations§
Source§impl Clone for SpringSolver
impl Clone for SpringSolver
impl Copy for SpringSolver
Source§impl Debug for SpringSolver
impl Debug for SpringSolver
Source§impl Default for SpringSolver
impl Default for SpringSolver
Source§impl PartialEq for SpringSolver
impl PartialEq for SpringSolver
impl StructuralPartialEq for SpringSolver
Auto Trait Implementations§
impl Freeze for SpringSolver
impl RefUnwindSafe for SpringSolver
impl Send for SpringSolver
impl Sync for SpringSolver
impl Unpin for SpringSolver
impl UnsafeUnpin for SpringSolver
impl UnwindSafe for SpringSolver
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more