A small library which helps estimate air density (rho) based on air temperature, pressure, dew point and altitude.
`npm install @mariuspopovici/rho`
- 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 if pressure is measured at sea level.
var rho = require('@mariuspopovici/rho');
// calculate Rho with values expressed in imperial units
var density = rho(68.9, 30.1, 68.9, 'imperial');
Output should be 1.1984
var rho = require('@mariuspopovici/rho');
// calculate Rho adjusted for altitude
var density = rho(29, 1010, 20, 'metric', 2000);
Output should be 0.9402
var rho = require('@mariuspopovici/rho');
// calculate Rho with values expressed in metric units (default)
var density = rho(20.5, 1019.3, 20.5);
Output should be 1.1984
Result is reported in kg/m3 and can be optionally converted to lb/ft3.
var rho = require('@mariuspopovici/rho');
// calculate Rho with values expressed in imperial units
var density = rho(68.9, 30.1, 68.9, 'imperial').toPoundsPerCubicFeet();
`npm test`
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.