Expand description
Units of thermodynamic temperature.
Each unit is defined relative to degrees Kelvin with a conversion factor and zero point. They can be used to conveniently create Temperature structs.
Example
use mag::temp::{DegC, DegF};
let a = 22.8 * DegC;
let b = 98.6 * DegF;
assert_eq!(a.to_string(), "22.8 °C");
assert_eq!(b.to_string(), "98.6 °F");
assert_eq!(b.to(), 37 * DegC);
Example: Delisle
use approx::assert_relative_eq;
use mag::{declare_unit, temp::DegC, quan::Temperature};
declare_unit!(Delisle, "°D", Temperature, -2.0 / 3.0, 559.73,);
let boiling = 0 * Delisle;
assert_eq!(boiling.to_string(), "0 °D");
assert_relative_eq!(
boiling.to::<DegC>().value,
100.0,
max_relative = 0.000_1
);
let freezing = 0 * DegC;
assert_relative_eq!(
freezing.to::<Delisle>().value,
150.0,
max_relative = 0.000_1
);