#[macro_use] extern crate unitary; use unitary::Qty; fn main() { units!(N, Pa, kg, m, s); let aliases = vec![ ( vec![(Units::kg, 1.0), (Units::m, 1.0), (Units::s, -2.0)], (Units::N, 1.0), ), (vec![(Units::N, 1.0), (Units::m, -2.0)], (Units::Pa, 1.0)), ]; let acceleration = Qty(1.0, vec![(Units::m, 1.0), (Units::s, -2.0)]); let mass = qty!(10.0; kg); let mut force = mass * acceleration; force.update(&aliases); println!("Force: {}", &force); let x = qty!(0.1; m); let y = qty!(1.0; m); let area = x * y; let mut pressure = force / area; pressure.update(&aliases); println!("{}", pressure); }