Rho
A small library which helps estimate air density (rho) based on air temperature, pressure and dew point.
Installation
`npm install @mariuspopovici/rho`
Usage
Parameters
- temperature Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on unit type.
- air pressure Air pressure in hPA or inHg depending on units type
- dew point Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on
- units of measurement Optional, defaults to metric. Change to imperial to indicate that inputs are in imperial units of measurement.
- altitude Optional, defaults to 0. Specify altitude to if pressure is measured at sea level.
Examples
var rho = ; // calculate Rho with values expressed in imperial units var density = ;
Output should be 1.1984
var rho = ; // calculate Rho adjusted for altitude var density = ;
Output should be 0.9402
var rho = ;// calculate Rho with values expressed in metric units (default)var density = ;
Output should be 1.1984
Result is reported in kg/m3 and can be optionally converted to lb/ft3.
var rho = ; // calculate Rho with values expressed in imperial units var density = ;
Tests
`npm test`
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.