UnitConverter Class

Module: Physics

The unit convertor is responsible for performing unit conversion between values.

Units are represented by their natural texture unit representation (m/s, km/s, n/m, etc).

Item Index

Methods

Attributes

Methods

convert

(
  • value
  • inUnit
  • outUnit
)
Number static

Convert a unit form one input unit to another unit.

Parameters:

  • value Number

    Input value to be converted.

  • inUnit Number

    Input original unit.

  • outUnit Number

    Input output unit.

Returns:

Number:

Retuns the value converted based on input and output units, if the value cannot be converted returns null.

Attributes

scales

Map static

Scale levels.

Is a map containing the scale symbol and its value.

units

Map static

List of known units.

It a map containing sub maps that contains methods that allow getting to the unit refered.