Skip to main content

spring_period

Function spring_period 

Source
pub fn spring_period(spring_constant: f64, mass: f64) -> Option<f64>
Expand description

Computes spring period using T = 2π * sqrt(m / k).

§Examples

use core::f64::consts::PI;
use use_oscillation::spring_period;

let period = spring_period(8.0, 2.0).unwrap();

assert!((period - PI).abs() < 1.0e-12);