-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
69 lines (67 loc) · 4.81 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Rho</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
<link href="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css" rel="stylesheet" type="text/css">
<style>
.task-list-item { list-style-type: none; } .task-list-item-checkbox { margin-left: -20px; vertical-align: middle; }
</style>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', 'Ubuntu', 'Droid Sans', sans-serif;
font-size: 14px;
line-height: 1.6;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js"></script>
</head>
<body>
<h1 id="rho">Rho</h1>
<p>A small library which helps estimate air density (rho) based on air temperature, pressure, dew point and altitude.</p>
<h2 id="installation">Installation</h2>
<pre><code>`npm install @mariuspopovici/rho`
</code></pre>
<h2 id="usage">Usage</h2>
<h3 id="parameters">Parameters</h3>
<ul>
<li><strong>temperature</strong> Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on unit type.</li>
<li><strong>air pressure</strong> Air pressure in hPA or inHg depending on units type</li>
<li><strong>dew point</strong> Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on</li>
<li><strong>units of measurement</strong> Optional, defaults to <em>metric</em>. Change to <em>imperial</em> to indicate that inputs are in <em>imperial</em> units of measurement.</li>
<li><strong>altitude</strong> Optional, defaults to 0. Specify altitude if pressure is measured at sea level.</li>
</ul>
<h3 id="examples">Examples</h3>
<pre><code class="language-javascript"><div> <span class="hljs-keyword">var</span> rho = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@mariuspopovici/rho'</span>);
<span class="hljs-comment">// calculate Rho with values expressed in imperial units</span>
<span class="hljs-keyword">var</span> density = rho(<span class="hljs-number">68.9</span>, <span class="hljs-number">30.1</span>, <span class="hljs-number">68.9</span>, <span class="hljs-string">'imperial'</span>);
</div></code></pre>
<pre><code>Output should be 1.1984
</code></pre>
<pre><code class="language-javascript"><div> <span class="hljs-keyword">var</span> rho = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@mariuspopovici/rho'</span>);
<span class="hljs-comment">// calculate Rho adjusted for altitude</span>
<span class="hljs-keyword">var</span> density = rho(<span class="hljs-number">29</span>, <span class="hljs-number">1010</span>, <span class="hljs-number">20</span>, <span class="hljs-string">'metric'</span>, <span class="hljs-number">2000</span>);
</div></code></pre>
<pre><code>Output should be 0.9402
</code></pre>
<pre><code class="language-javascript"><div> <span class="hljs-keyword">var</span> rho = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@mariuspopovici/rho'</span>);
<span class="hljs-comment">// calculate Rho with values expressed in metric units (default)</span>
<span class="hljs-keyword">var</span> density = rho(<span class="hljs-number">20.5</span>, <span class="hljs-number">1019.3</span>, <span class="hljs-number">20.5</span>);
</div></code></pre>
<pre><code>Output should be 1.1984
</code></pre>
<p>Result is reported in kg/m<sup>3</sup> and can be optionally converted to lb/ft<sup>3</sup>.</p>
<pre><code class="language-javascript"><div> <span class="hljs-keyword">var</span> rho = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@mariuspopovici/rho'</span>);
<span class="hljs-comment">// calculate Rho with values expressed in imperial units</span>
<span class="hljs-keyword">var</span> density = rho(<span class="hljs-number">68.9</span>, <span class="hljs-number">30.1</span>, <span class="hljs-number">68.9</span>, <span class="hljs-string">'imperial'</span>).toPoundsPerCubicFeet();
</div></code></pre>
<h2 id="tests">Tests</h2>
<pre><code>`npm test`
</code></pre>
<h2 id="contributing">Contributing</h2>
<p>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.</p>
</body>
</html>