eng-units
Rust library to build, calculate and convert custom engineering units.
Project Goals
- Easy to use engineering units and calculations
- No panics
- No dependencies
- 100% testing coverage
Example Usage
Creating units
let quarter_pounder = mass!;
assert_eq!;
assert_eq!;
Converting units
let quarter_pounder = mass!;
let royal_with_cheese = quarter_pounder.convert;
assert_eq!;
Engineering calculations
let temp_1 = temperature!;
let mass_1 = mass!;
let t_1 = time!;
let unit = temp_1 * mass_1 / t_1;
assert_eq!;
assert_eq!;
let double = 2.0 * unit;
assert_eq!;
assert_eq!;
let flip = double.reciprocal;
assert_eq!;
assert_eq!;
let mass_2 = mass!;
let canceled_out = flip * mass_2;
assert_eq!;
assert_eq!;
Test coverage status
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.