danwi 0.4.2

Zero-cost dimensional analysis library with SI units, compile-time checking, and no_std support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use danwi::f64::{QuantityExt, constants::MN};

fn main() {
    let mass_flow = 680.0.kg() / 1.0.s();
    let specific_impulse = 350.0.s();
    let exhaust_velocity = specific_impulse * danwi::f64::G_0;

    let thrust = mass_flow * exhaust_velocity;
    println!("thrust: {:.2}", thrust.display_as(MN)); // 2.33 MN

    let burn_time = 6.0.minute();
    let propellant = mass_flow * burn_time;
    println!("propellant: {} t", propellant.value() / 1000.0); // 244.8 t
}