pub struct PendulumConfig {
pub length: f64,
pub mass: f64,
pub g: f64,
pub damping: f64,
pub initial_angle: f64,
pub initial_angular_velocity: f64,
}Expand description
Configuration for a simple pendulum.
Fields§
§length: f64Length of pendulum (m).
mass: f64Mass of bob (kg).
g: f64Gravitational acceleration (m/s²).
damping: f64Damping coefficient (kg/s).
initial_angle: f64Initial angle (radians, 0 = hanging down).
initial_angular_velocity: f64Initial angular velocity (rad/s).
Implementations§
Source§impl PendulumConfig
impl PendulumConfig
Sourcepub fn small_angle() -> Self
pub fn small_angle() -> Self
Create a small-angle pendulum (linearized regime).
Sourcepub fn large_angle() -> Self
pub fn large_angle() -> Self
Create a large-angle pendulum (nonlinear regime).
Sourcepub fn small_angle_period(&self) -> f64
pub fn small_angle_period(&self) -> f64
Get theoretical period for small oscillations.
Trait Implementations§
Source§impl Clone for PendulumConfig
impl Clone for PendulumConfig
Source§fn clone(&self) -> PendulumConfig
fn clone(&self) -> PendulumConfig
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 PendulumConfig
impl Debug for PendulumConfig
Source§impl Default for PendulumConfig
impl Default for PendulumConfig
Source§impl<'de> Deserialize<'de> for PendulumConfig
impl<'de> Deserialize<'de> for PendulumConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PendulumConfig
impl RefUnwindSafe for PendulumConfig
impl Send for PendulumConfig
impl Sync for PendulumConfig
impl Unpin for PendulumConfig
impl UnsafeUnpin for PendulumConfig
impl UnwindSafe for PendulumConfig
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