Class: Units

PD. Units


new Units()

Provides classes and tools for converting between multiple different units.

This namespace includes a range of classes that encapsulate different categories of unit types that can all be directly converted between each other. For example, a PD.Units.Temperature object can store a value in degrees Celsius, Fahrenheit, Rankine or Kelvin, and convert between them. A PD.Units.Energy object stores values in Joules, Btu, foot-pounds-force or horsepower and convert between them.

However, an energy value cannot be converted into a temperature nor a temperature into an energy value. Thus, using different objects for each category of units hopefully makes for a clearer and more robust API for handling units and their conversions.

Author:
  • drajmarsh

Classes

Enthalpy
HumidityRatio
Pressure
SpecificVolume
Temperature
Velocity

Members


:number

ATMOSPHERES <static, constant>

The PD.Units.Pressure identifier for Atmospheres (atm).

Type
  • number

:number

BAR <static, constant>

The PD.Units.Pressure identifier for bar (bar).

Type
  • number

:number

BTU_PER_POUND <static, constant>

The PD.Units.Enthalpy identifier for British thermal units per pound (Btu/lb).

Type
  • number

:number

CELSIUS <static, constant>

The PD.Units.Temperature identifier for degrees Celsius (°C).

Type
  • number

:number

CUBIC_FEET_PER_POUND <static, constant>

The PD.Units.SpecificVolume identifier for cubic feet per pound (ft3/lb).

Type
  • number

:number

CUBIC_METERS_PER_KILOGRAM <static, constant>

The PD.Units.SpecificVolume identifier for cubic meters per kilogram (m3/kg).

Type
  • number

:number

FAHRENHEIT <static, constant>

The PD.Units.Temperature identifier for degrees Fahrenheit (°F).

Type
  • number

:number

FEET_PER_MINUTE <static, constant>

The PD.Units.Velocity identifier for feet per second (ft/s).

Type
  • number

:number

FEET_PER_SECOND <static, constant>

The PD.Units.Velocity identifier for feet per second (ft/s).

Type
  • number

:number

GRAINS_PER_POUND <static, constant>

The PD.Units.HumidityRatio identifier for grains of water per pound of dry air (gr/lb).

Type
  • number

:number

GRAMS_PER_KILOGRAM <static, constant>

The PD.Units.HumidityRatio identifier for grams of water per kilogram of dry air (g/kg).

Type
  • number

:number

INCHES_MERCURY <static, constant>

The PD.Units.Pressure identifier for inches of mercury (inHg).

Type
  • number

:number

JOULES_PER_KILOGRAM <static, constant>

The PD.Units.Enthalpy identifier for Joules per kilogram (m3/kg).

Type
  • number

:number

KELVIN <static, constant>

The PD.Units.Temperature identifier for degrees Kelvin (K).

Type
  • number

:number

KILOGRAMS_PER_KILOGRAM <static, constant>

The PD.Units.HumidityRatio identifier for kilograms of water per kilogram of dry air (kg/kg).

Type
  • number

:number

KILOMETERS_PER_HOUR <static, constant>

The PD.Units.Velocity identifier for kilometres per hour (km/h).

Type
  • number

:number

KILOPASCAL <static, constant>

The PD.Units.Pressure identifier for kilo-Pascal (Pa).

Type
  • number

:number

KILO_JOULES_PER_KILOGRAM <static, constant>

The PD.Units.Enthalpy identifier for kilo-Joules per kilogram (m3/kg).

Type
  • number

:number

KNOTS <static, constant>

The PD.Units.Velocity identifier for knots (kn).

Type
  • number

:number

METERS_PER_SECOND <static, constant>

The PD.Units.Velocity identifier for meters per second (m/s).

Type
  • number

:number

MILES_PER_HOUR <static, constant>

The PD.Units.Velocity identifier for miles per hour (mph).

Type
  • number

:number

MILLIMETERS_MERCURY <static, constant>

The PD.Units.Pressure identifier for millimeters of mercury (mmHg).

Type
  • number

:number

PASCAL <static, constant>

The PD.Units.Pressure identifier for Pascal (Pa).

Type
  • number

:number

POUNDS_PER_POUND <static, constant>

The PD.Units.HumidityRatio identifier for pounds of water per pound of dry air (lb/lb).

Type
  • number

:number

POUNDS_PER_SQUARE_INCH <static, constant>

The PD.Units.Pressure identifier for pounds per square inch (Psi).

Type
  • number

:number

RANKINE <static, constant>

The PD.Units.Temperature identifier for degrees Rankine (°R).

Type
  • number