measurements 0.11.1

Handle metric, imperial, and other measurements with ease! Types: Length, Temperature, Weight, Volume, Pressure
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
fn main() {
    // Sinusiodal Oscilator moves at 5 Hz across 50 mm
    let f = measurements::Frequency::from_hertz(5.0);
    let d = measurements::Distance::from_millimeters(50.0);
    // Speed = PI * Frequency * Displacement
    // Speed = PI * Displacement / Period
    let v = std::f64::consts::PI * d / f.as_period();
    println!(
        "Maximum speed of a pendulum at {:.1} with max displacement {:.1} is {:.1}",
        f, d, v
    );
}