quant

Crates.ioquant
lib.rsquant
version0.0.4
sourcesrc
created_at2015-04-11 18:47:23.426641
updated_at2015-12-11 23:55:29.371301
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
id1842
size19,270
Owners (github:uuid-rs:owners)

documentation

README

Quant

A library that makes it easy to work w/ Dimensions, Units, and Physical Quantities. It is currently a complete work in progress.

Example

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
}

TODO

  • Documentation.
  • More tests.
  • named method for derived units.
  • Implement other unimplemented methods.
  • Parser.
  • Check uncertainty for methods such as pow, mul, etc.
  • Trig. functions for rad.
  • Update description.
Commit count: 0

cargo fmt