| Crates.io | quant |
| lib.rs | quant |
| version | 0.0.4 |
| created_at | 2015-04-11 18:47:23.426641+00 |
| updated_at | 2015-12-11 23:55:29.371301+00 |
| description | (Not ready to use yet) A library that makes it easy to work w/ Dimensions, Units, and Physical Quantities. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1842 |
| size | 19,270 |
A library that makes it easy to work w/ Dimensions, Units, and Physical Quantities. It is currently a complete work in progress.
Start by adding the following to your Cargo.toml file:
Crates
[dependencies]
quant = "*"
Then add the following to your main.rs file:
extern crate quant;
use quant::{kilogram, metre, second};
fn main() {
let kilogram = kilogram();
let distance = metre();
let time = second();
let interval = time.clone();
println!("One newton (N) is the force needed to accelerate \
{} of mass at the rate of {} per {} per {}.",
kilogram, distance, time, interval);
let speed = distance.per(time);
let acceleration = speed.per(interval);
let newton = kilogram * acceleration;
println!("{}", newton.named()) // 1 newton
}
named method for derived units.unimplemented methods.uncertainty for methods such as pow, mul, etc.