Package Exports
- @mariuspopovici/rho
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mariuspopovici/rho) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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 = 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();
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.