[][src]Crate ndarray_unit

This module provides a struct being a simple representation of the international measure system and an Enum containing all of the seven base unit of the Internation SI.
It allows to multiply and divise unit between them and to print them.
Several utility functions are provided to construct your own derived Unit from the base ones

Exemples

use ndarray_unit;
use ndarray_unit::{Unit, BaseUnit};

let meter_per_sec = Unit::from_vec(vec![(BaseUnit::METER, 1), (BaseUnit::SECOND, -1)]);
println!("meter_per_sec = {}", meter_per_sec);

let acceleration = &meter_per_sec / &ndarray_unit::get_second();
println!("acceleration = {}", acceleration);

Output

// meter_per_sec = m·s⁻¹
// acceleration = m·s⁻²

Structs

Unit

Enums

BaseUnit

An enum representing the seven units of the International System of Units

Functions

get_ampere

Utility method to get a Unit from a BaseUnit (BaseUnit::AMPERE)

get_becquerel

Utility method to get the becquerel Unit (composed)

get_candela

Utility method to get a Unit from a BaseUnit (BaseUnit::CANDELA)

get_coulomb

Utility method to get the Coulomb Unit (composed)

get_farad

Utility method to get the Coulomb Unit (composed)

get_henry

Utility method to get the Henry Unit (composed)

get_hertz

Utility method to get the Hertz Unit (composed)

get_joule

Utility method to get the Joule Unit (composed)

get_kelvin

Utility method to get a Unit from a BaseUnit (BaseUnit::KELVIN)

get_meter

Utility method to get a Unit from a BaseUnit (BaseUnit::METER)

get_mole

Utility method to get a Unit from a BaseUnit (BaseUnit::MOLE)

get_newton

Utility method to get the Joule Unit (composed)

get_ohm

Utility method to get the Ohm Unit (composed)

get_pascal

Utility metgod to get the Pascal Unit (composed)

get_second

Utility method to get a Unit from a BaseUnit (BaseUnit::SECOND)

get_siemens

Utility method to get the Siemens Unit (composed)

get_tesla

Utility method to get the Tesla Unit (composed)

get_volt

Utility method to get the Volt Unit (composed)

get_watt

Utility method to get the Watt Unit (composed)

get_weber

Utility method to get the Weber Unit (composed)