SI Units System for Ruby


VanUnits provides a powerful SI units system which integrates directly into Ruby's method dispatch system. With it, one can quickly perform typed calculations and conversions.

Here are few simple examples:

      reqiure 'van/units'
      include Units**2)**2)
      1.bit/s + 8.bytes/s

Pretty scienterrific, yes?

Also included are real world contants in both 'cm kg s' and 'm kg s' formats. Some examples...

      require 'van/units/constants'

      Van::Units::Constants::MKS::SPEED_OF_LIGHT    #=> 2.99792458e8 m/s
      Van::Units::Constants::CGS::SPEED_OF_LIGHT    #=> 2.99792458e10 cm/s


NIST Reference Reference material for SI Constants, Units and Uncertianty.
MathWorld A free resource from Wolfram Research built on Mathematica technology.


VanUnits is copyrighted by Peter Vanbroekhoven. Some adapted works also have respective copyrights to their contributors.

VanUnits is distributed under the terms of the MIT license.

All ad revenues support RubyWorks, a collection of open source projects.