-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
35 lines (31 loc) · 1.13 KB
/
index.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
<script src="pt.js"></script>
<link href="https://jonasalmeida.github.io/jmat/jmat.css" rel="stylesheet">
<h2>Periodic Table toobox</h2>
<p>[<a href="https://github.com/mathbiol/periodictable" target="_blank">Source</a>][<a href="https://github.com/mathbiol/periodictable/issues" target="_blank">Issues</a>]</p>
<hr>
<p>Nothing to see here, this toolbox is running in the console. Try for example:</p>
<p>
<pre> Na + Cl</pre>
<pre> > 58.439769282 </pre>
<pre> H*2 + O</pre>
<pre> > 18.015 </pre>
<pre> C*6 + H*12 + O*6</pre>
<pre> > 180.156 </pre>
<pre> H*2 + S + O*4</pre>
<pre> > 98.072 </pre>
</p>
<hr>
<p>You can also try it with molecules, using the periodic table's eval method:</p>
<pre> pt.eval('H2SO4')</pre>
<pre> > 98.072 </pre>
<p>pt.eval will also recognize multiplier prefixes as one will often find in reaction formulas with </p>
<pre> pt.eval('2H2SO4')</pre>
<pre> > 196.144 </pre>
<pre> pt.eval('C9H8O4')</pre>
<pre> > 180.159 </pre>
<pre> pt.eval('pt.eval('CH3COOC6H4COOH')')</pre>
<pre> > 180.159 </pre>
<pre> pt.eval('pt.eval('CH3COOC6H4COOH')')</pre>
<pre> > 180.159 </pre>
<pre> pt.eval('Ca(OH)2')</pre>
<pre> > 74.0924 </pre>