emacs.d/clones/lisp/www.cliki.net/physical-quantities.html

95 lines
6.1 KiB
HTML
Raw Normal View History

2022-10-07 15:47:14 +02:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: physical-quantities</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=physical-quantities">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - physical-quantities</span>
<div id="content"><div id="content-area"><div id="article-title">physical-quantities</div><div id="article">A library for processing physical quantities: values, <a href="units.html" class="category">units</a>, (and uncertainty).<p><h3>Features:</h3>
<ul>
<li>Each quantity has a value, an (optional) unit, and an (optional) uncertainty.
</li>
<li>Calculations are done using special functions like q+ or qsqrt.
</li>
<li>Units and uncertainty are affected by calculations:
<ul>
<li>Unit combination
</li>
<li>Error propagation
</li>
</ul>
</li>
<li>Units can be converted.
</li>
<li>Convenient read-macro to define quantities: #q(1 kg).
</li>
<li>Value, unit, and uncertainty can be accessed, if needed.
</li>
<li>
<a href="https://en.wikipedia.org/wiki/International_System_of_Units">SI units</a> are predefined.
</li>
<li>Any other units can be defined.
</li>
</ul><p><h3>Usage:</h3>
<div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_providecm_require.html" class="symbol">require</a> <span class="keyword">:asdf</span></span>)</span>
<span class="paren1">(<span class="nonparen">asdf:load-system <span class="keyword">:physical-quantities</span></span>)</span>
<span class="paren1">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_use-package.html" class="symbol">use-package</a> <span class="keyword">:physical-quantities}</span>
<span class="paren2">(<span class="nonparen"><i><span class="symbol">define-si-units</span></i></span>)</span>
<span class="paren2">(<span class="nonparen"><i><span class="symbol">define-read-macros</span></i></span>)</span>
<span class="paren2">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/speope_letcm_letst.html" class="symbol"><i><span class="symbol">let</span></i></a> <span class="paren3">(<span class="nonparen">m c E</span>)</span>
<span class="comment">;; Define the mass
</span> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_setf.html" class="symbol">setf</a> m #q<span class="paren4">(<span class="nonparen">1.00 +/- 0.01 kg</span>)</span></span>)</span>
<span class="comment">;; The speed of light
</span> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_setf.html" class="symbol">setf</a> c #q<span class="paren4">(<span class="nonparen">299792458 m / s</span>)</span></span>)</span>
<span class="comment">;; E = m * c^2
</span> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/any_setf.html" class="symbol">setf</a> E <span class="paren4">(<span class="nonparen">q* m <span class="paren5">(<span class="nonparen">qpow c 2</span>)</span></span>)</span></span>)</span>
<span class="comment">;; Print E, converted to petajoule
</span> <span class="paren3">(<span class="nonparen"><a href="https://www.cliki.net/site/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" class="symbol">print</a> #q<span class="paren4">(<span class="nonparen">E -&gt; PJ</span>)</span></span>)</span></span>)</span>
</span></span></span></div><p><h3>Homepage:</h3>
<a href="https://github.com/mrossini-ethz/physical-quantities">https://github.com/mrossini-ethz/physical-quantities</a><p><h3>Installation:</h3>
physical-quantities can be installed through <a href="Quicklisp.html" class="internal">Quicklisp</a>.<p><h3>License:</h3>
<a href="GPL.html" class="category">GPL</a></div></div>
<div id="footer" class="buttonbar"><ul><li><a href="physical-quantities.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=physical-quantities">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=physical-quantities">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=physical-quantities&amp;from-revision=3781451518">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>