rink 0.4.2

Unit conversion tool and library, similar to frink
Documentation
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
#
# This file is the units database for use with GNU units, a units conversion
# program by Adrian Mariano adrianm@gnu.org
#
# August 2015 Version 2.13
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006
#               2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
# Free Software Foundation, Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA  02110-1301  USA
#
############################################################################
#
# Improvements and corrections are welcome.
#
# Fundamental constants in this file are the 2014 CODATA recommended values.
#
# Most units data was drawn from
#            1. NIST Special Publication 811, Guide for the
#                 Use of the International System of Units (SI).
#                 Barry N. Taylor. 1995
#            2. CRC Handbook of Chemistry and Physics 70th edition
#            3. Oxford English Dictionary
#            4. Websters New Universal Unabridged Dictionary
#            5. Units of Measure by Stephen Dresner
#            6. A Dictionary of English Weights and Measures by Ronald Zupko
#            7. British Weights and Measures by Ronald Zupko
#            8. Realm of Measure by Isaac Asimov
#            9. United States standards of weights and measures, their
#                   creation and creators by Arthur H. Frazier.
#           10. French weights and measures before the Revolution: a
#                   dictionary of provincial and local units by Ronald Zupko
#           11. Weights and Measures: their ancient origins and their
#                   development in Great Britain up to AD 1855 by FG Skinner
#           12. The World of Measurements by H. Arthur Klein
#           13. For Good Measure by William Johnstone
#           14. NTC's Encyclopedia of International Weights and Measures
#                   by William Johnstone
#           15. Sizes by John Lord
#           16. Sizesaurus by Stephen Strauss
#           17. CODATA Recommended Values of Physical Constants available at
#                   http://physics.nist.gov/cuu/Constants/index.html
#           18. How Many?  A Dictionary of Units of Measurement.  Available at
#                   http://www.unc.edu/~rowlett/units/index.html
#           19. Numericana.  http://www.numericana.com
#           20. UK history of measurement
#                   http://www.ukmetrication.com/history.htm
#           21. NIST Handbook 44, Specifications, Tolerances, and
#                 Other Technical Requirements for Weighing and Measuring
#                 Devices. 2011
#           22. NIST Special Publication 447, Weights and Measures Standards
#                 of the the United States: a brief history. Lewis V. Judson.
#                 1963; rev. 1976
#
# Thanks to Jeff Conrad for assistance in ferreting out unit definitions.
#
###########################################################################
#
# If units you use are missing or defined incorrectly, please contact me.
# If your country's local units are missing and you are willing to supply
# them, please send me a list.
#
# I added shoe size information but I'm not convinced that it's correct.
# If you know anything about shoe sizes please contact me.
#
###########################################################################

###########################################################################
#
# Brief Philosophy of this file
#
# Most unit definitions are made in terms of integers or simple fractions of
# other definitions.  The typical exceptions are when converting between two
# different unit systems, or the values of measured physical constants.  In
# this file definitions are given in the most natural and revealing way in
# terms of integer factors.
#
# If you make changes be sure to run 'units --check' to check your work.
#
# The file is USA-centric, but there is some modest effort to support other
# countries.  This file is now coded in UTF-8.  To support environments where
# UTF-8 is not available, definitions that require this character set are
# wrapped in !utf8 directives.
#
# When a unit name is used in different countries with the different meanings
# the system should be as follows:
#
# Suppose countries ABC and XYZ both use the "foo".  Then globally define
#
#   ABCfoo  <some value>
#   XYZfoo  <different value>
#
# Then, using the !locale directive, define the "foo" appropriately for each of
# the two countries with a definition like
#
# !locale ABC
#    foo  ABCfoo
# !endlocale
#
###########################################################################

!locale en_US
!  set UNITS_ENGLISH US
!endlocale

!locale en_GB
!  set UNITS_ENGLISH GB
!endlocale

!set UNITS_ENGLISH US   # Default setting for English units

###########################################################################
#                                                                         #
# Primitive units.  Any unit defined to contain a '!' character is a      #
# primitive unit which will not be reduced any further.  All units should #
# reduce to primitive units.                                              #
#                                                                         #
###########################################################################

#
# SI units
#

!category base_units "SI Base Units"

?? Equal to the mass of the international prototype of the
?? kilogram. 3rd CGPM (1901, CR, 70).
kg        !kilogram

?? Duration of 9192631770 periods of the radiation corresponding to
?? the transition between the two hyperfine levels of the ground state
?? of the cesium-133 atom at rest at a temperature of 0 K. 13th CGPM
?? (1968/68, Resolution 1; CR; 103).
s         !second

?? Length of the path travelled by light in vacuum during a time
?? interval of 1 / 299 792 458 of a second. 17th CGPM (1983, CR, 70).
m         !meter

?? The constant current which, if maintained in two straight parallel
?? conductors of infinite length, of negligible circular
?? cross-section, and placed 1 meter apart in vacuum, would produce
?? between those conductors a force equal to 2e-7 newton per meter of
?? length. 9th CGPM (1948).
A         !ampere
amp       A

?? The luminous intensity, in a given direction, of a source that
?? emits monochromatic radiation of frequency 540e12 hertz and that
?? has a radiant intensity in that direction of 1/683 watt per
?? steradian. 16th CGPM (1979, Resolution 3; CR, 100).
cd        !candela

?? The amount of substance a system which contains as many elementary
?? entities as there are atoms in 0.012 kilogram of carbon 12 at rest
?? and in their ground state. When the mole is used, the elementary
?? entities must be specified and may be atoms, molecules, ions,
?? electrons, other particles, or specified groups of such
?? particles. 14th CGPM (1971, Resolution 3; CR, 78).
mol       !mole

?? The fraction 1 / 273.16 of the thermodynamic temperature of the
?? triple point of water. 13th CGPM (1967/68, Resolution 4; CR, 104).
K         !kelvin

!endcategory

#
# The radian and steradian are defined as dimensionless primitive units.
# The radian is equal to m/m and the steradian to m^2/m^2 so these units are
# dimensionless.  Retaining them as named units is useful because it allows
# clarity in expressions and makes the meaning of unit definitions more clear.
# These units will reduce to 1 in conversions but not for sums of units or for
# arguments to functions.
#

?? The angle subtended at the center of a circle by an arc equal in
?? length to the radius of the circle
radian    !

?? Solid angle which cuts off an area of the surface of the sphere
?? equal to that of a square with sides of length equal to the radius
?? of the sphere
sr        !steradian

#
# Some primitive non-SI units
#

?? Basic unit of information (entropy).  The entropy in bits of a
?? random variable over a finite alphabet is defined to be the sum of
?? -p(i)*log2(p(i)) over the alphabet where p(i) is the probability
?? that the random variable takes on the value i.
bit       !

###########################################################################
#                                                                         #
# Prefixes (longer names must come first)                                 #
#                                                                         #
###########################################################################

#!category prefixes "Prefixes"

yotta-                  1e24     # Greek or Latin octo, "eight"
zetta-                  1e21     # Latin septem, "seven"
exa-                    1e18     # Greek hex, "six"
peta-                   1e15     # Greek pente, "five"
tera-                   1e12     # Greek teras, "monster"
giga-                   1e9      # Greek gigas, "giant"
mega-                   1e6      # Greek megas, "large"
myria-                  1e4      # Not an official SI prefix
kilo-                   1e3      # Greek chilioi, "thousand"
hecto-                  1e2      # Greek hekaton, "hundred"
deca-                   1e1      # Greek deka, "ten"
deka-                   deca
deci-                   1e-1     # Latin decimus, "tenth"
centi-                  1e-2     # Latin centum, "hundred"
milli-                  1e-3     # Latin mille, "thousand"
micro-                  1e-6     # Latin micro or Greek mikros, "small"
nano-                   1e-9     # Latin nanus or Greek nanos, "dwarf"
pico-                   1e-12    # Spanish pico, "a bit"
femto-                  1e-15    # Danish-Norwegian femten, "fifteen"
atto-                   1e-18    # Danish-Norwegian atten, "eighteen"
zepto-                  1e-21    # Latin septem, "seven"
yocto-                  1e-24    # Greek or Latin octo, "eight"

quarter--               1|4
semi--                  0.5
demi--                  0.5
hemi--                  0.5
half-                   0.5
double-                 2
triple-                 3
treble-                 3

kibi-                   2^10     # In response to the convention of illegally
mebi-                   2^20     # and confusingly using metric prefixes for
gibi-                   2^30     # powers of two, the International
tebi-                   2^40     # Electrotechnical Commission aproved these
pebi-                   2^50     # binary prefixes for use in 1998.  If you
exbi-                   2^60     # want to refer to "megabytes" using the
Ki--                    kibi     # binary definition, use these prefixes.
Mi--                    mebi
Gi--                    gibi
Ti--                    tebi
Pi--                    pebi
Ei--                    exbi

Y--                     yotta
Z--                     zetta
E--                     exa
P--                     peta
T--                     tera
G--                     giga
M--                     mega
k--                     kilo
h--                     hecto
da--                    deka
d--                     deci
c--                     centi
m--                     milli
u--                     micro   # it should be a mu but u is easy to type
n--                     nano
p--                     pico
f--                     femto
a--                     atto
z--                     zepto
y--                     yocto

#!endcategory

#
# Names of some numbers
#

!category numbers "Numbers"

one                     1
two                     2
double                  2
couple                  2
three                   3
triple                  3
four                    4
quadruple               4
five                    5
quintuple               5
six                     6
seven                   7
eight                   8
nine                    9
ten                     10
eleven                  11
twelve                  12
thirteen                13
fourteen                14
fifteen                 15
sixteen                 16
seventeen               17
eighteen                18
nineteen                19
twenty                  20
thirty                  30
forty                   40
fifty                   50
sixty                   60
seventy                 70
eighty                  80
ninety                  90
hundred                 100
thousand                1000
million                 1e6

!endcategory

# These number terms were described by N. Chuquet and De la Roche in the 16th
# century as being successive powers of a million.  These definitions are still
# used in most European countries.  The current US definitions for these
# numbers arose in the 17th century and don't make nearly as much sense.  These
# numbers are listed in the CRC Concise Encyclopedia of Mathematics by Eric
# W. Weisstein.

!category short_system "Short System"

shortbillion               1e9
shorttrillion              1e12
shortquadrillion           1e15
shortquintillion           1e18
shortsextillion            1e21
shortseptillion            1e24
shortoctillion             1e27
shortnonillion             1e30
shortnoventillion          shortnonillion
shortdecillion             1e33
shortundecillion           1e36
shortduodecillion          1e39
shorttredecillion          1e42
shortquattuordecillion     1e45
shortquindecillion         1e48
shortsexdecillion          1e51
shortseptendecillion       1e54
shortoctodecillion         1e57
shortnovemdecillion        1e60
shortvigintillion          1e63

!endcategory

centillion              1e303
googol                  1e100

!category long_system "Long System"

longbillion               million^2
longtrillion              million^3
longquadrillion           million^4
longquintillion           million^5
longsextillion            million^6
longseptillion            million^7
longoctillion             million^8
longnonillion             million^9
longnoventillion          longnonillion
longdecillion             million^10
longundecillion           million^11
longduodecillion          million^12
longtredecillion          million^13
longquattuordecillion     million^14
longquindecillion         million^15
longsexdecillion          million^16
longseptdecillion         million^17
longoctodecillion         million^18
longnovemdecillion        million^19
longvigintillion          million^20

# These numbers fill the gaps left by the long system above.

milliard                1000 million
billiard                1000 million^2
trilliard               1000 million^3
quadrilliard            1000 million^4
quintilliard            1000 million^5
sextilliard             1000 million^6
septilliard             1000 million^7
octilliard              1000 million^8
nonilliard              1000 million^9
noventilliard           nonilliard
decilliard              1000 million^10

# For consistency

longmilliard              milliard
longbilliard              billiard
longtrilliard             trilliard
longquadrilliard          quadrilliard
longquintilliard          quintilliard
longsextilliard           sextilliard
longseptilliard           septilliard
longoctilliard            octilliard
longnonilliard            nonilliard
longnoventilliard         noventilliard
longdecilliard            decilliard

!endcategory

# The long centillion would be 1e600.  The googolplex is another
# familiar large number equal to 10^googol.  These numbers give overflows.

#
# The short system prevails in English speaking countries
#

billion                 shortbillion
trillion                shorttrillion
quadrillion             shortquadrillion
quintillion             shortquintillion
sextillion              shortsextillion
septillion              shortseptillion
octillion               shortoctillion
nonillion               shortnonillion
noventillion            shortnoventillion
decillion               shortdecillion
undecillion             shortundecillion
duodecillion            shortduodecillion
tredecillion            shorttredecillion
quattuordecillion       shortquattuordecillion
quindecillion           shortquindecillion
sexdecillion            shortsexdecillion
septendecillion         shortseptendecillion
octodecillion           shortoctodecillion
novemdecillion          shortnovemdecillion
vigintillion            shortvigintillion

#
# Numbers used in India
#

lakh                    1e5
crore                   1e7
arab                    1e9
kharab                  1e11
neel                    1e13
padm                    1e15
shankh                  1e17

#############################################################################
#                                                                           #
# Derived units which can be reduced to the primitive units                 #
#                                                                           #
#############################################################################



#
# Named SI derived units (officially accepted)
#

!category si_derived "SI Derived Units"

newton                  kg m / s^2   # force
N                       newton
pascal                  N/m^2        # pressure or stress
Pa                      pascal
joule                   N m          # energy
J                       joule
watt                    J/s          # power
W                       watt
coulomb                 A s          # charge
C                       coulomb
volt                    W/A          # potential difference
V                       volt
ohm                     V/A          # electrical resistance
siemens                 A/V          # electrical conductance
S                       siemens
farad                   C/V          # capacitance
F                       farad
weber                   V s          # magnetic flux
Wb                      weber
henry                   Wb/A         # inductance
H                       henry
tesla                   Wb/m^2       # magnetic flux density
T                       tesla
hertz                   /s           # frequency
Hz                      hertz

!endcategory

#
# Dimensions.  These are here to help with dimensional analysis and
# because they will appear in the list produced by hitting '?' at the
# "You want:" prompt to tell the user the dimension of the unit.
#

dimensionless           ? 1
length                  ? meter
area                    ? length^2
volume                  ? length^3
mass                    ? kilogram
current                 ? ampere
amount                  ? mole
angle                   ? radian
solid_angle             ? steradian
force                   ? newton
pressure                ? pascal
stress                    pascal
charge                  ? coulomb
capacitance             ? farad
resistance              ? ohm
conductance             ? siemens
inductance              ? henry
frequency               ? hertz
velocity                ? length / time
acceleration            ? velocity / time
jerk                    ? acceleration / time
snap                    ? jerk / time
crackle                 ? snap / time
pop                     ? crackle / time
density                 ? mass / volume
linear_density          ? mass / length
viscosity               ? pressure time
kinematic_viscosity     ? viscosity / density
magnetic_flux           ? weber
magnetic_flux_density   ? tesla
magnetization           ? current / length
electrical_potential    ? volt
electric_field          ? newton / coulomb
entropy                 ? energy / temperature
thermal_inductance      ? energy temperature^2 / power^2
permittivity            ? farad / meter
permeability            ? henry / meter
angular_momentum        ? mass area / time
area_density            ? mass / area
catalytic_activity      ? amount / time
chemical_potential      ? energy / amount
molar_concentration     ? amount / volume
current_density         ? current / area
electric_charge_density ? charge / volume
electric_displacement   ? charge / area
impulse                 ? mass length / time
heat_flux_density       ? power / area
molar_entropy           ? entropy / amount
moment_of_inertia       ? mass area
reaction_rate           ? amount / volume time
specific_heat_capacity  ? energy / mass temperature
specific_volume         ? volume / mass
surface_tension         ? energy / area
fuel_efficiency         ? area^-1
specific_energy         ? energy / mass
molar_mass              ? mass / amount
flow_rate               ? volume / time
pressure_column         ? pressure / length


#
# units derived easily from SI units
#

gram                    1|1000 kg
gm                      gram
g                       gram
tonne                   1000 kg
t                       tonne
metricton               tonne
sthene                  tonne m / s^2
funal                   sthene
pieze                   sthene / m^2
quintal                 100 kg
bar                     1e5 Pa     # About 1 atm
#b                       bar
vac                     millibar
micron                  micrometer # One millionth of a meter
bicron                  picometer  # One brbillionth of a meter
cc                      cm^3
are                     100 m^2
a                       are
liter                   1000 cc       # The liter was defined in 1901 as the
oldliter                1.000028 dm^3 # space occupied by 1 kg of pure water at
L                       liter         # the temperature of its maximum density
l                       liter         # under a pressure of 1 atm.  This was
                                      # supposed to be 1000 cubic cm, but it
                                      # was discovered that the original
                                      # measurement was off.  In 1964, the
                                      # liter was redefined to be exactly 1000
                                      # cubic centimeters.
mho                     siemens    # Inverse of ohm, hence ohm spelled backward
galvat                  ampere     # Named after Luigi Galvani
angstrom                1e-10 m    # Convenient for describing molecular sizes
xunit                   xunit_cu      # Used for measuring x-ray wavelengths.
siegbahn                xunit         # Originally defined to be 1|3029.45 of
xunit_cu             1.00207697e-13 m # the spacing of calcite planes at 18
xunit_mo             1.00209952e-13 m # degC.  It was intended to be exactly
                                      # 1e-13 m, but was later found to be
                                      # slightly off.  Current usage is with
                                      # reference to common x-ray lines, either
                                      # the K-alpha 1 line of copper or the
                                      # same line of molybdenum.
angstromstar            1.00001495 angstrom # Defined by JA Bearden in 1965
fermi                   1e-15 m    # Convenient for describing nuclear sizes
                                   #   Nuclear radius is from 1 to 10 fermis
barn                    1e-28 m^2  # Used to measure cross section for
                                   #   particle physics collision, said to
                                   #   have originated in the phrase "big as
                                   #   a barn".
shed                    1e-24 barn # Defined to be a smaller companion to the
                                   #   barn, but it's too small to be of
                                   #   much use.
brewster                micron^2/N # measures stress-optical coef
diopter                 /m         # measures reciprocal of lens focal length
fresnel                 1e12 Hz    # occasionally used in spectroscopy
shake                   1e-8 sec
svedberg                1e-13 s    # Used for measuring the sedimentation
                                   # coefficient for centrifuging.
gamma                   microgram  # Also used for 1e-9 tesla
lambda                  microliter
spat                    1e12 m     # Rarely used for astronomical measurements
preece                  1e13 ohm m # resistivity
planck                  J s        # action of one joule over one second
sturgeon                /henry     # magnetic reluctance
daraf                   1/farad    # elastance (farad spelled backwards)
leo                     10 m/s^2
poiseuille              N s / m^2  # viscosity
mayer                   J/g K      # specific heat
mired                   / microK   # reciprocal color temperature.  The name
                                   #   abbreviates micro reciprocal degree.
crocodile               megavolt   # used informally in UK physics labs
metricounce             25 g
mounce                  metricounce
finsenunit              1e5 W/m^2  # Measures intensity of ultraviolet light
                                   # with wavelength 296.7 nm.
fluxunit                1e-26 W/m^2 Hz # Used in radio astronomy to measure
                                       #   the energy incident on the receiving
                                       #   body across a specified frequency
                                       #   bandwidth.  [12]
jansky                  fluxunit   # K. G. Jansky identified radio waves coming
Jy                      jansky     # from outer space in 1931.
flick       W / cm^2 sr micrometer # Spectral radiance or irradiance
pfu                    / cm^2 sr s # particle flux unit -- Used to measure
                                   #   rate at which particles are received by
                                   #   a spacecraft as particles per solid
                                   #   angle per detector area per second. [18]
pyron            cal_IT / cm^2 min # Measures heat flow from solar radiation,
                                   #   from Greek work "pyr" for fire.
katal                   mol/sec    # Measure of the amount of a catalyst.  One
kat                     katal      #   katal of catalyst enables the reaction
                                   #   to consume or produce on mol/sec.

#
# time
#

sec                     s
minute                  60 s
min                     minute
hour                    60 min
hr                      hour
h                       hour
day                     24 hr
d                       day
da                      day
week                    7 day
wk                      week
sennight                7 day
fortnight               14 day
blink                   1e-5 day   # Actual human blink takes 1|3 second
ce                      1e-2 day
cron                    1e6 years
watch                   4 hours    # time a sentry stands watch or a ship's
                                   # crew is on duty.
bell                    1|8 watch  # Bell would be sounded every 30 minutes.

# French Revolutionary Time or Decimal Time.  It was Proposed during
# the French Revolution.  A few clocks were made, but it never caught
# on.  In 1998 Swatch defined a time measurement called ".beat" and
# sold some watches that displayed time in this unit.

decimalhour             1|10 day
decimalminute           1|100 decimalhour
decimalsecond           1|100 decimalminute
beat                    decimalminute          # Swatch Internet Time

#
# angular measure
#

circle                  2 pi radian
degree                  1|360 circle
deg                     degree
arcdeg                  degree
arcmin                  1|60 degree
arcminute               arcmin
'                       arcmin
arcsec                  1|60 arcmin
arcsecond               arcsec
#"                       arcsec
#''                      "
rightangle              90 degrees
quadrant                1|4 circle
quintant                1|5 circle
sextant                 1|6 circle

sign                    1|12 circle # Angular extent of one sign of the zodiac
turn                    circle
revolution              turn
rev                     turn
pulsatance              radian / sec
gon                     1|100 rightangle  # measure of grade
grade                   gon
centesimalminute        1|100 grade
centesimalsecond        1|100 centesimalminute
milangle                1|6400 circle     # Official NIST definition.
                                          # Another choice is 1e-3 radian.
pointangle              1|32 circle  # Used for reporting compass readings
centrad                 0.01 radian  # Used for angular deviation of light
                                     # through a prism.
mas                     milli arcsec # Used by astronomers
seclongitude            circle (seconds/day) # Astronomers measure longitude
                                     # (which they call right ascension) in
                                     # time units by dividing the equator into
                                     # 24 hours instead of 360 degrees.
#
# Some geometric formulas
#

#circlearea(r)   units=[m;m^2] range=[0,) pi r^2 ; sqrt(circlearea/pi)
#spherevolume(r) units=[m;m^3] range=[0,) 4|3 pi r^3 ; \
#                                         cuberoot(spherevolume/4|3 pi)
#spherevol()     spherevolume
#square(x)       range=[0,)          x^2 ; sqrt(square)

#
# Solid angle measure
#

sphere                  4 pi sr
squaredegree            1|180^2 pi^2 sr
squareminute            1|60^2 squaredegree
squaresecond            1|60^2 squareminute
squarearcmin            squareminute
squarearcsec            squaresecond
sphericalrightangle     0.5 pi sr
octant                  0.5 pi sr

#
# Concentration measures
#

!category concentrations "Concentrations"

percent                 0.01
%                       percent
mill                    0.001     # Originally established by Congress in 1791
                                  # as a unit of money equal to 0.001 dollars,
                                  # it has come to refer to 0.001 in general.
                                  # Used by some towns to set their property
                                  # tax rate, and written with a symbol similar
                                  # to the % symbol but with two 0's in the
                                  # denominator.  [18]
proof                   1|200     # Alcohol content measured by volume at
                                  # 60 degrees Fahrenheit.  This is a USA
                                  # measure.  In Europe proof=percent.
ppm                     1e-6
partspermillion         ppm
ppb                     1e-9
partsperbillion         ppb       # USA billion
ppt                     1e-12
partspertrillion        ppt       # USA trillion
karat                   1|24      # measure of gold purity
caratgold               karat
gammil                  mg/l
basispoint              0.01 %    # Used in finance
fine                    1|1000    # Measure of gold purity

!endcategory

# The pH scale is used to measure the concentration of hydronium (H3O+) ions in
# a solution.  A neutral solution has a pH of 7 as a result of dissociated
# water molecules.

#pH(x) units=[1;mol/liter] range=(0,) 10^(-x) mol/liter ; (-log(pH liters/mol))


#
# Temperature
#
# Two types of units are defined: units for converting temperature differences
# and functions for converting absolute temperatures.  Conversions for
# differences start with "deg" and conversions for absolute temperature start
# with "temp".
#

temperature             ? kelvin
temperature_difference  kelvin

# In 1741 Anders Celsius introduced a temperature scale with water boiling at
# 0 degrees and freezing at 100 degrees at standard pressure. After his death
# the fixed points were reversed and the scale was called the centigrade
# scale.  Due to the difficulty of accurately measuring the temperature of
# melting ice at standard pressure, the centigrade scale was replaced in 1954
# by the Celsius scale which is defined by subtracting 273.15 from the
# temperature in Kelvins.  This definition differed slightly from the old
# centigrade definition, but the Kelvin scale depends on the triple point of
# water rather than a melting point, so it can be measured accurately.

#tempC(x) units=[1;K] domain=[-273.15,) range=[0,) \
#                             x K + stdtemp ; (tempC +(-stdtemp))/K
#tempcelsius() tempC
#degcelsius              K
#degC                    K

# Fahrenheit defined his temperature scale by setting 0 to the coldest
# temperature he could produce in his lab with a salt water solution and by
# setting 96 degrees to body heat.  In Fahrenheit's words:
#
#    Placing the thermometer in a mixture of sal ammoniac or sea
#    salt, ice, and water a point on the scale will be found which
#    is denoted as zero. A second point is obtained if the same
#    mixture is used without salt. Denote this position as 30. A
#    third point, designated as 96, is obtained if the thermometer
#    is placed in the mouth so as to acquire the heat of a healthy
#    man."  (D. G. Fahrenheit, Phil. Trans. (London) 33, 78, 1724)

#tempF(x) units=[1;K] domain=[-459.67,) range=[0,) \
#                (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32
#tempfahrenheit() tempF
#degfahrenheit           5|9 degC
#degF                    5|9 degC


degreesrankine          5|9 K             # The Rankine scale has the
degrankine              degreesrankine    # Fahrenheit degree, but its zero
degreerankine           degreesrankine    # is at absolute zero.
degR                    degrankine
tempR                   degrankine
temprankine             degrankine

reaumur_absolute        10|8 kelvin
romer_absolute          40|21 kelvin
delisle_absolute        -2|3 kelvin
newton_absolute         100|33 kelvin

zerocelsius             273.15 K
zerofahrenheit          zerocelsius - 32 degR
zerodelisle             373.15 kelvin
zeroromer               zerocelsius - 7.5 romer_absolute

#tempreaumur(x)    units=[1;K] domain=[-218.52,) range=[0,) \
#                  x degreaumur+stdtemp ; (tempreaumur+(-stdtemp))/degreaumur
#degreaumur              10|8 degC # The Reaumur scale was used in Europe and
                                  # particularly in France.  It is defined
                                  # to be 0 at the freezing point of water
                                  # and 80 at the boiling point.  Reaumur
                                  # apparently selected 80 because it is
                                  # divisible by many numbers.

degK                    K         # "Degrees Kelvin" is forbidden usage.
tempK                   K         # For consistency

# Gas mark is implemented below but in a terribly ugly way.  There is
# a simple formula, but it requires a conditional which is not
# presently supported.
#
# The formula to convert to degrees Fahrenheit is:
#
# 25 log2(gasmark) + k_f   gasmark<=1
# 25 (gasmark-1) + k_f     gasmark>=1
#
# k_f = 275
#
#gasmark[degR] \
#  .0625    634.67 \
#  .125     659.67 \
#  .25      684.67 \
#  .5       709.67 \
#  1        734.67 \
#  2        759.67 \
#  3        784.67 \
#  4        809.67 \
#  5        834.67 \
#  6        859.67 \
#  7        884.67 \
#  8        909.67 \
#  9        934.67 \
#  10       959.67

# Units cannot handle wind chill or heat index because they are two variable
# functions, but they are included here for your edification.  Clearly these
# equations are the result of a model fitting operation.
#
# wind chill index (WCI) a measurement of the combined cooling effect of low
#      air temperature and wind on the human body. The index was first defined
#      by the American Antarctic explorer Paul Siple in 1939. As currently used
#      by U.S. meteorologists, the wind chill index is computed from the
#      temperature T (in °F) and wind speed V (in mi/hr) using the formula:
#          WCI = 0.0817(3.71 sqrt(V) + 5.81 - 0.25V)(T - 91.4) + 91.4.
#      For very low wind speeds, below 4 mi/hr, the WCI is actually higher than
#      the air temperature, but for higher wind speeds it is lower than the air
#      temperature.
#
# heat index (HI or HX) a measure of the combined effect of heat and
#      humidity on the human body. U.S. meteorologists compute the index
#      from the temperature T (in °F) and the relative humidity H (as a
#      value from 0 to 1).
#        HI = -42.379 + 2.04901523 T + 1014.333127 H - 22.475541 TH
#             - .00683783 T^2 - 548.1717 H^2 + 0.122874 T^2 H + 8.5282 T H^2
#             - 0.0199 T^2 H^2.

#
# Physical constants
#

# Basic constants

!category constants "Physical Constants"

π                       3.14159265358979323846
pi                      π
τ                       2 pi
tau                     τ
c                       speed of light   # speed of light in vacuum (exact)
#light                   c
mu0                     4 pi 1e-7 H/m    # permeability of vacuum (exact)
epsilon0                1/mu0 c^2        # permittivity of vacuum (exact)
mass_energy             c^2              # convert mass to energy
planck_constant         6.626070040e-34 J s
hbar                    planck_constant / 2 pi
spin                    hbar
G               6.67408e-11 N m^2 / kg^2 # Newtonian gravitational constant
                                         #    This is the NIST 2006 value.
                                         #    The relative uncertainty on this
                                         #    is 1e-4.
coulombconst            1/4 pi epsilon0  # listed as "k" sometimes

# Physico-chemical constants

atomicmassunit        1.660539040e-27 kg # atomic mass unit (defined to be
u                       atomicmassunit   #   1|12 of the mass of carbon 12)
amu                     atomicmassunit
amu_chem                1.66026e-27 kg   # 1|16 of the weighted average mass of
                                         #   the 3 naturally occuring neutral
                                         #   isotopes of oxygen
amu_phys                1.65981e-27 kg   # 1|16 of the mass of a neutral
                                         #   oxygen 16 atom
dalton                  u                # Maybe this should be amu_chem?
avogadro                grams/amu mol    # size of a mole
N_A                     avogadro
gasconstant             boltzmann N_A    # molar gas constant
R                       gasconstant
boltzmann             1.38064852e-23 J/K # Boltzmann constant
#k                       boltzmann
kboltzmann              boltzmann
molarvolume         mol R stdtemp / atm  # Volume occupied by one mole of an
                                         #   ideal gas at STP.
loschmidt     avogadro mol / molarvolume # Molecules per cubic meter of an
                                         #   ideal gas at STP.  Loschmidt did
                                         #   work similar to Avogadro.
stefanboltzmann pi^2 boltzmann^4 / 60 hbar^3 c^2 # The power per area radiated by a
sigma                   stefanboltzmann  #   blackbody at temperature T is
                                         #   given by sigma T^4.
wiendisplacement        2.8977729e-3 m K # Wien's Displacement Law gives the
                                         #   frequency at which the the Planck
                                         #   spectrum has maximum intensity.
                                         #   The relation is lambda T = b where
                                         #   lambda is wavelength, T is
                                         #   temperature and b is the Wien
                                         #   displacement.  This relation is
                                         #   used to determine the temperature
                                         #   of stars.
K_J90 483597.9 GHz/V    # Direct measurement of the volt is difficult.  Until
K_J   483597.8525 GHz/V #   recently, laboratories kept Weston cadmium cells as
                        #   a reference, but they could drift.  In 1987 the
                        #   CGPM officially recommended the use of the
                        #   Josephson effect as a laboratory representation of
                        #   the volt.  The Josephson effect occurs when two
                        #   superconductors are separated by a thin insulating
                        #   layer.  A "supercurrent" flows across the insulator
                        #   with a frequency that depends on the potential
                        #   applied across the superconductors.  This frequency
                        #   can be very accurately measured.  The Josephson
                        #   constant K_J, which is equal to 2e/h, relates the
                        #   measured frequency to the potential.  Two values
                        #   given, the conventional (exact) value from 1990 and
                        #   the current CODATA measured value.
R_K90 25812.807 ohm     # Measurement of the ohm also presents difficulties.
R_K   25812.8074555 ohm #   The old approach involved maintaining resistances
                        #   that were subject to drift.  The new standard is
                        #   based on the Hall effect.  When a current carrying
                        #   ribbon is placed in a magnetic field, a potential
                        #   difference develops across the ribbon.  The ratio
                        #   of the potential difference to the current is
                        #   called the Hall resistance.  Klaus von Klitzing
                        #   discovered in 1980 that the Hall resistance varies
                        #   in discrete jumps when the magnetic field is very
                        #   large and the temperature very low.  This enables
                        #   accurate realization of the resistance h/e^2 in the
                        #   lab.  Two values given, the conventional (exact)
                        #   value from 1990 and the current CODATA measured
                        #   value.

# Various conventional values

gravity                 9.80665 m/s^2    # std acceleration of gravity (exact)
force                   gravity          # use to turn masses into forces
atm                     101325 Pa        # Standard atmospheric pressure
atmosphere              atm
mach                    331.46 m/s       # speed of sound in dry air at STP
standardtemp            273.15 K         # standard temperature
stdtemp                 standardtemp
normaltemp              529.67 degR      # for gas density, from NIST
normtemp                normaltemp       # Handbook 44

# Atomic constants

Rinfinity            10973731.568539 /m  # The wavelengths of a spectral series
R_H                     10967760 /m      #   can be expressed as
                                         #     1/lambda = R (1/m^2 - 1/n^2).
                                         #   where R is a number that various
                                         #   slightly from element to element.
                                         #   For hydrogen, R_H is the value,
                                         #   and for heavy elements, the value
                                         #   approaches Rinfinity, which can be
                                         #   computed from
                                         #        m_e c alpha^2 / 2 h
                                         #   with a loss of 4 digits
                                         #   of precision.
alpha                   7.2973525664e-3  # The fine structure constant was
                                         #   introduced to explain fine
                                         #   structure visible in spectral
                                         #   lines.  It can be computed from
                                         #         mu0 c e^2 / 2 h
                                         #   with a loss of 3 digits precision
                                         #   and loss of precision in derived
                                         #   values which use alpha.
bohrradius              alpha / 4 pi Rinfinity
prout                   185.5 keV        # nuclear binding energy equal to 1|12
                                         #   binding energy of the deuteron
# Planck constants

planckmass              2.17651e-8 kg     # sqrt(hbar c / G)
m_P                     planckmass
plancktime              hbar / planckmass c^2
t_P                     plancktime
plancklength            plancktime c
l_P                     plancklength

# Magnetic moments

bohrmagneton            electroncharge hbar / mass of 2 electron
mu_B                    bohrmagneton
nuclearmagneton         electroncharge hbar / mass of 2 proton
mu_N                    nuclearmagneton

#
# Units derived from physical constants
#

kgf                     kg force
technicalatmosphere     kgf / cm^2
at                      technicalatmosphere
hyl                     kgf s^2 / m   # Also gram-force s^2/m according to [15]
torr                    atm / 760  # These units, both named after Evangelista
tor                     Pa         # Torricelli, should not be confused.  The
eV                      electroncharge V # Energy acquired by a particle with charge e
electronvolt            eV       #   when it is accelerated through 1 V
lightyear               c julianyear # The 365.25 day year is specified in
ly                      lightyear    # NIST publication 811
lightsecond             c s
lightminute             c min
parsec                  32313140071200 km
pc                      parsec
#parsec                  au / tan(arcsec)    # Unit of length equal to distance
#pc                      parsec              #   from the sun to a point having
                                            #   heliocentric parallax of 1
                                            #   arcsec (derived from parallax
                                            #   second).  A distant object with
                                            #   paralax theta will be about
                                            #   (arcsec/theta) parsecs from the
                                            #   sun (using the approximation
                                            #   that tan(theta) = theta).
rydberg                 planck_constant c Rinfinity # Rydberg energy
crith                   0.089885 gram       # The crith is the mass of one
                                            #   liter of hydrogen at standard
                                            #   temperature and pressure.
amagatvolume            molarvolume
amagat                  mol/amagatvolume    # Used to measure gas densities
lorentz                 bohrmagneton / planck_constant c # Used to measure the extent
                                            #   that the frequency of light
                                            #   is shifted by a magnetic field.
cminv                   planck_constant c / cm # Unit of energy used in infrared
invcm                   cminv               #   spectroscopy.
wavenumber              cminv
kcal_mol                kcal_th / mol N_A   # kcal/mol is used as a unit of
                                            #   energy by physical chemists.

!endcategory

#
# CGS system based on centimeter, gram and second
#

!category cgs "CGS Units"

dyne                    cm gram / s^2   # force
dyn                     dyne
erg                     cm dyne         # energy
poise                   gram / cm s     # viscosity, honors Jean Poiseuille
P                       poise
rhe                     /poise          # reciprocal viscosity
stokes                  cm^2 / s        # kinematic viscosity
St                      stokes
stoke                   stokes
lentor                  stokes          # old name
Gal                     cm / s^2        # acceleration, used in geophysics
galileo                 Gal             # for earth's gravitational field
                                        # (note that "gal" is for gallon
                                        # but "Gal" is the standard symbol
                                        # for the gal which is evidently a
                                        # shortened form of "galileo".)
barye                   dyne/cm^2       # pressure
barad                   barye           # old name
kayser                  1/cm            # Proposed as a unit for wavenumber
balmer                  kayser          # Even less common name than "kayser"
kine                    cm/s            # velocity
bole                    g cm / s        # momentum
pond                    gram force
glug                gram force s^2 / cm # Mass which is accelerated at
                                        #   1 cm/s^2 by 1 gram force
darcy           centipoise cm^2 / s atm # Measures permeability to fluid flow.

                                        #   One darcy is the permeability of a
                                        #   medium that allows a flow of cc/s
                                        #   of a liquid of centipoise viscosity
                                        #   under a pressure gradient of
                                        #   atm/cm.  Named for H. Darcy.

mobileohm               cm / dyn s      # mobile ohm, measure of mechanical
                                        #   mobility
mechanicalohm           dyn s / cm      # mechanical resistance
acousticalohm           dyn s / cm^5    # ratio of the sound pressure of
                                        #   1 dyn/cm^2 to a source of strength
                                        #   1 cm^3/s
ray                     acousticalohm
rayl                    dyn s / cm^3    # Specific acoustical resistance
eotvos                  1e-9 Gal/cm     # Change in gravitational acceleration
                                        #   over horizontal distance

# Electromagnetic units derived from the abampere

abampere                10 A            # Current which produces a force of
abamp                   abampere        #   2 dyne/cm between two infinitely
aA                      abampere        #   long wires that are 1 cm apart
biot                    aA              # alternative name for abamp
Bi                      biot
abcoulomb               abamp sec
abcoul                  abcoulomb
abfarad                 abampere sec / abvolt
abhenry                 abvolt sec / abamp
abvolt                  dyne cm  / abamp sec
abohm                   abvolt / abamp
abmho                   /abohm
gauss                   abvolt sec / cm^2
Gs                      gauss
maxwell                 abvolt sec      # Also called the "line"
Mx                      maxwell
oersted                 gauss / mu0
Oe                      oersted
gilbert                 gauss cm / mu0
Gi                      gilbert
unitpole                4 pi maxwell
emu                     erg/gauss  # "electro-magnetic unit", a measure of
                                   # magnetic moment, often used as emu/cm^3
                                   # to specify magnetic moment density.

# Gaussian system: electromagnetic units derived from statampere.
#
# Note that the Gaussian units are often used in such a way that Coulomb's law
# has the form F= q1 * q2 / r^2.  The constant 1|4*pi*epsilon0 is incorporated
# into the units.  From this, we can get the relation force=charge^2/dist^2.
# This means that the simplification esu^2 = dyne cm^2 can be used to simplify
# units in the Gaussian system, with the curious result that capacitance can be
# measured in cm, resistance in sec/cm, and inductance in sec^2/cm.  These
# units are given the names statfarad, statohm and stathenry below.

statampere              10 A cm / s c
statamp                 statampere
statvolt                dyne cm / statamp sec
statcoulomb             statamp s
esu                     statcoulomb
statcoul                statcoulomb
statfarad               statamp sec / statvolt
cmcapacitance           statfarad
stathenry               statvolt sec / statamp
statohm                 statvolt / statamp
statmho                 /statohm
statmaxwell             statvolt sec
franklin                statcoulomb
debye                   1e-18 statcoul cm # unit of electrical dipole moment
helmholtz               debye/angstrom^2  # Dipole moment per area
jar                     1000 statfarad    # approx capacitance of Leyden jar

#
# Some historical electromagnetic units
#

intampere               0.999835 A    # Defined as the current which in one
intamp                  intampere     #   second deposits .001118 gram of
                                      #   silver from an aqueous solution of
                                      #   silver nitrate.
intfarad                0.999505 F
intvolt                 1.00033 V
intohm                  1.000495 ohm  # Defined as the resistance of a
                                      #   uniform column of mercury containing
                                      #   14.4521 gram in a column 1.063 m
                                      #   long and maintained at 0 degC.
daniell                 1.042 V       # Meant to be electromotive force of a
                                      #   Daniell cell, but in error by .04 V
faraday                 N_A electroncharge mol # Charge that must flow to deposit or
faraday_phys            96521.9 C     #   liberate one gram equivalent of any
faraday_chem            96495.7 C     #   element.  (The chemical and physical
                                      #   values are off slightly from what is
                                      #   obtained by multiplying by amu_chem
                                      #   or amu_phys.  These values are from
                                      #   a 1991 NIST publication.)  Note that
                                      #   there is a Faraday constant which is
                                      #   equal to N_A e and hence has units of
                                      #   C/mol.
kappline                6000 maxwell  # Named by and for Gisbert Kapp
siemensunit             0.9534 ohm    # Resistance of a meter long column of
                                      #   mercury with a 1 mm cross section.

!endcategory

#
# Printed circuit board units.
#
# http://www.ndt-ed.org/GeneralResources/IACS/IACS.htm.
#
# Conductivity is often expressed as a percentage of IACS.  A copper wire a
# meter long with a 1 mm^2 cross section has a resistance of 1|58 ohm at
# 20 deg C.  Copper density is also standarized at that temperature.
#

copperconductivity      58 siemens m / mm^2     # A wire a meter long with
IACS                    copperconductivity      #   a 1 mm^2 cross section
copperdensity           8.89 g/cm^3             # The "ounce" measures the
ouncecopper             oz / ft^2 copperdensity #   thickness of copper used
ozcu                    ouncecopper             #   in circuitboard fabrication

#
# Radiometric units
#

!category radiometric "Radiometric Units"

radiant_energy                    J       # Basic unit of radiation
radiant_energy_density            J/m^3
radiant_flux                      W
spectral_flux_frequency           W/Hz
spectral_flux_wavelength        ? W/m
radiant_intensity               ? W/sr
spectral_intensity_frequency    ? W sr^-1 Hz^-1
spectral_intensity_wavelength   ? W sr^-1 m^-1
radiance                        ? W sr^-1 m^-2
spectral_radiance_frequency     ? W sr^-1 m^-2 Hz^-1
spectral_radiance_wavelength    ? W sr^-1 m^-3
spectral_irradiance_frequency     W m^-2 Hz^-1
spectral_irradiance_wavelength  ? W/m^3
radiosity                         W/m^2
spectral_radiosity_frequency      W m^-2 Hz^-1
spectral_radiosity_wavelength     W m^-3
radiant_exitance                  W/m^2
spectral_exitance_frequency       W m^-2 Hz^-1
spectral_exitance_wavelength      W/m^3
radiant_exposure                  J/m^2
spectral_exposure_frequency     ? J m^-2 Hz^-1
spectral_exposure_wavelength      J/m^3

!endcategory

#
# Photometric units
#

!category photometric "Photometric Units"

luminous_intensity      ? candela
luminous_flux           ? lumen
luminous_energy         ? talbot
illuminance             ? lux

candle                  1.02 candela  # Standard unit for luminous intensity
hefnerunit              0.9 candle    #   in use before candela
hefnercandle            hefnerunit    #
violle                  20.17 cd      # luminous intensity of 1 cm^2 of
                                      #   platinum at its temperature of
                                      #   solidification (2045 K)

lumen                   cd sr         # Luminous flux (luminous energy per
lm                      lumen         #    time unit)

talbot                  lumen s       # Luminous energy
lumberg                 talbot        # References give these values for
lumerg                  talbot        #    lumerg and lumberg both.  Note that
                                      #    a paper from 1948 suggests that
                                      #    lumerg should be 1e-7 talbots so
                                      #    that lumergs/erg = talbots/joule.
                                      #    lumerg = luminous erg
lux                     lm/m^2        # Illuminance or exitance (luminous
lx                      lux           #   flux incident on or coming from
phot                    lumen / cm^2  #   a surface)
ph                      phot          #
footcandle              lumen/ft^2    # Illuminance from a 1 candela source
                                      #    at a distance of one foot
metercandle             lumen/m^2     # Illuminance from a 1 candela source
                                      #    at a distance of one meter

mcs                     metercandle s # luminous energy per area, used to
                                      #    measure photographic exposure

nox                     1e-3 lux      # These two units were proposed for
skot                    1e-3 apostilb # measurements relating to dark adapted
                                      # eyes.
# Luminance measures

luminance               ? nit

nit                     cd/m^2        # Luminance: the intensity per projected
stilb                   cd / cm^2     # area of an extended luminous source.
sb                      stilb         # (nit is from latin nitere = to shine.)

apostilb                cd/pi m^2
asb                     apostilb
blondel                 apostilb      # Named after a French scientist.

# Equivalent luminance measures.  These units are units which measure
# the luminance of a surface with a specified exitance which obeys
# Lambert's law.  (Lambert's law specifies that luminous intensity of
# a perfectly diffuse luminous surface is proportional to the cosine
# of the angle at which you view the luminous surface.)

equivalentlux           cd / pi m^2   # luminance of a 1 lux surface
equivalentphot          cd / pi cm^2  # luminance of a 1 phot surface
lambert                 cd / pi cm^2
footlambert             cd / pi ft^2

# The bril is used to express "brilliance" of a source of light on a
# logarithmic scale to correspond to subjective perception.  An increase of 1
# bril means doubling the luminance.  A luminance of 1 lambert is defined to
# have a brilliance of 1 bril.

#bril(x) units=[1;lambert]  2^(x+-100) lamberts ;log2(bril/lambert)+100

#
# Photographic Exposure Value
# This section by Jeff Conrad (jeff_conrad@msn.com)
#
# The Additive system of Photographic EXposure (APEX) proposed in ASA
# PH2.5-1960 was an attempt to simplify exposure determination for people who
# relied on exposure tables rather than exposure meters.  Shortly thereafter,
# nearly all cameras incorporated exposure meters, so the APEX system never
# caught on, but the concept of exposure value remains in use.  Though given as
# 'Ev' in ASA PH2.5-1960, it is now more commonly indicated by 'EV'.  EV is
# related to exposure parameters by
#
#            A^2   LS   ES
#     2^EV = --- = -- = --
#             t    K    C
#
# Where
#     A = Relative aperture (f-number)
#     t = Exposure time in seconds
#     L = Scene luminance in cd/m2
#     E = Scene illuminance in lux
#     S = Arithmetic ISO speed
#     K = Reflected-light meter calibration constant
#     C = Incident-light meter calibration constant
#
# Strictly, an exposure value is a combination of aperture and exposure time,
# but it's also commonly used to indicate luminance (or illuminance).
# Conversion to luminance or illuminance units depends on the ISO speed and the
# meter calibration constant.  Common practice is to use an ISO speed of 100.
# Calibration constants vary among camera and meter manufacturers: Canon,
# Nikon, and Sekonic use a value of 12.5 for reflected-light meters, while
# Kenko (formerly Minolta) and Pentax use a value of 14.  Kenko and Sekonic use
# a value of 250 for incident-light meters with flat receptors.
#
# The values for in-camera meters apply only averaging, weighted-averaging, or
# spot metering--the multi-segment metering incorporated in most current
# cameras uses proprietary algorithms that evaluate many factors related to the
# luminance distribution of what is being metered; they are not amenable to
# simple conversions, and are usually not disclosed by the manufacturers.

s100                    100 / lx s            # ISO 100 speed
iso100                  s100

# Reflected-light meter calibration constant with ISO 100 speed

k1250                   12.5 (cd/m^2) / lx s   # For Canon, Nikon, and Sekonic
k1400                   14   (cd/m^2) / lx s   # For Kenko (Minolta) and Pentax

# Incident-light meter calibration constant with ISO 100 film

c250                    250 lx / lx s         # flat-disc receptor

# Exposure value to scene luminance with ISO 100 imaging media

# For Kenko (Minolta) or Pentax
#ev100(x) units=[;cd/m^2] range=(0,) 2^x k1400 / s100; log2(ev100 s100/k1400)
# For Canon, Nikon, or Sekonic
#ev100(x) units=[1;cd/m^2] range=(0,) 2^x k1250 / s100; log2(ev100 s100/k1250)
#EV100()  ev100

# Exposure value to scene illuminance with ISO 100 imaging media

#iv100(x) units=[1;lx] range=(0,) 2^x c250 / s100; log2(iv100 s100 / c250)

# Other Photographic Exposure Conversions
#
# As part of APEX, ASA PH2.5-1960 proposed several logarithmic quantities
# related by
#
#    Ev = Av + Tv = Bv + Sv
#
# where
#  Av = log2(A^2)       Aperture value
#  Tv = log2(1/t)       Time value
#  Sv = log2(N Sx)      Speed value
#  Bv = log2(B S / K)   Luminance ("brightness") value
#  Iv = log2(I S / C)   Illuminance value
#
# and
#  A  = Relative aperture (f-number)
#  t  = Exposure time in seconds
#  Sx = Arithmetic ISO speed in 1/lux s
#  B  = luminance in cd/m2
#  I  = luminance in lux

# The constant N derives from the arcane relationship between arithmetic
# and logarithmic speed given in ASA PH2.5-1960.  That relationship
# apparently was not obvious--so much so that it was thought necessary
# to explain it in PH2.12-1961.  The constant has had several values
# over the years, usually without explanation for the changes.  Although
# APEX had little impact on consumer cameras, it has seen a partial
# resurrection in the Exif standards published by the Camera & Imaging
# Products Association of Japan.

#N_apex         2^-1.75 lx s    # precise value implied in ASA PH2.12-1961,
                                # derived from ASA PH2.5-1960.
#N_apex         0.30 lx s       # rounded value in ASA PH2.5-1960,
                                # ASA PH2.12-1961, and ANSI PH2.7-1986
#N_apex         0.3162 lx s     # value in ANSI PH2.7-1973
N_exif          1|3.125 lx s    # value in Exif 2.3 (2010), making Sv(5) = 100
K_apex1961      11.4 (cd/m^2) / lx s    # value in ASA PH2.12-1961
K_apex1971      12.5 (cd/m^2) / lx s    # value in ANSI PH3.49-1971; more common
C_apex1961      224 lx / lx s   # value in PH2.12-1961 (20.83 for I in
                                #   footcandles; flat sensor?)
C_apex1971      322 lx / lx s   # mean value in PH3.49-1971 (30 +/- 5 for I in
                                # footcandles; hemispherical sensor?)
N_speed         N_exif
K_lum           K_apex1971
C_illum         C_apex1961

# Units for Photographic Exposure Variables
#
# Practical photography sometimes pays scant attention to units for exposure
# variables.  In particular, the "speed" of the imaging medium is treated as if
# it were dimensionless when it should have units of reciprocal lux seconds;
# this practice works only because "speed" is almost invariably given in
# accordance with international standards (or similar ones used by camera
# manufacturers)--so the assumed units are invariant.  In calculating
# logarithmic quantities--especially the time value Tv and the exposure value
# EV--the units for exposure time ("shutter speed") are often ignored; this
# practice works only because the units of exposure time are assumed to be in
# seconds, and the missing units that make the argument to the logarithmic
# function dimensionless are silently provided.
#
# In keeping with common practice, the definitions that follow treat "speeds"
# as dimensionless, so ISO 100 speed is given simply as '100'.  When
# calculating the logarithmic APEX quantities Av and Tv, the definitions
# provide the missing units, so the times can be given with any appropriate
# units.  For example, giving an exposure time of 1 minute as either '1 min' or
# '60 s' will result in Tv of -5.9068906.
#
# Exposure Value from f-number and Exposure Time
#
# Because nonlinear unit conversions only accept a single quantity,
# there is no direct conversion from f-number and exposure time to
# exposure value EV.  But the EV can be obtained from a combination of
# Av and Tv.  For example, the "sunny 16" rule states that correct
# exposure for a sunlit scene can achieved by using f/16 and an exposure
# time equal to the reciprocal of the ISO speed in seconds; this can be
# calculated as
#
#    ~Av(16) + ~Tv(1|100 s),
#
# which gives 14.643856.  These conversions may be combined with the
# ev100 conversion:
#
#    ev100(~Av(16) + ~Tv(1|100 s))
#
# to yield the assumed average scene luminance of 3200 cd/m^2.

# convert relative aperture (f-number) to aperture value
#Av(A)           units=[1;1] domain=[-2,) range=[0.5,)  2^(A/2); 2 log2(Av)
# convert exposure time to time value
#Tv(t)           units=[1;s] range=(0,)  2^(-t) s; log2(s / Tv)
# convert logarithmic speed Sv in ASA PH2.5-1960 to ASA/ISO arithmetic speed;
# make arithmetic speed dimensionless
# 'Sv' conflicts with the symbol for sievert; you can uncomment this function
# definition if you don't need that symbol
#Sv(S)    units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sv)
#Sval(S)   units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sval)

# convert luminance value Bv in ASA PH2.12-1961 to luminance
#Bv(x)           units=[1;cd/m^2] range=(0,) \
#                2^x K_lum N_speed ; log2(Bv / (K_lum N_speed))

# convert illuminance value Iv in ASA PH2.12-1961 to illuminance
#Iv(x)           units=[1;lx] range=(0,) \
#                2^x C_illum N_speed ; log2(Iv / (C_illum N_speed))

# convert ASA/ISO arithmetic speed Sx to ASA logarithmic speed in
# ASA PH2.5-1960; make arithmetic speed dimensionless
#Sx(S)           units=[1;1] domain=(0,) \
#                log2((N_speed/lx s) S); 2^Sx / (N_speed/lx s)

# convert DIN speed/ISO logarithmic speed in ISO 6:1993 to arithmetic speed
# for convenience, speed is treated here as if it were dimensionless
#Sdeg(S)         units=[1;1] range=(0,) 10^((S - 1) / 10) ; (1 + 10 log(Sdeg))
#Sdin()          Sdeg

# Numerical Aperture and f-Number of a Lens
#
# The numerical aperture (NA) is given by
#
#   NA = n sin(theta)
#
# where n is the index of refraction of the medium and theta is half
# of the angle subtended by the aperture stop from a point in the image
# or object plane. For a lens in air, n = 1, and
#
#   NA = 0.5 / f-number
#
# convert NA to f-number
#numericalaperture(x) units=[1;1] domain=(0,1] range=[0.5,) \
#                     0.5 / x ; 0.5 / numericalaperture
#NA()            numericalaperture
#
# convert f-number to itself; restrict values to those possible
#fnumber(x)      units=[1;1] domain=[0.5,) range=[0.5,) x ; fnumber

# Referenced Photographic Standards
#
# ASA PH-2.5-1960. USA Standard, Method for Determining (Monochrome,
#    Continuous-Tone) Speed of Photographic Negative Materials.
# ASA PH2.12-1961. American Standard, General-Purpose Photographic
#    Exposure Meters (photoelectric type).
# ANSI PH3.49-1971. American National Standard for general-purpose
#    photographic exposure meters (photoelectric type).
# ANSI PH2.7-1973. American National Standard Photographic Exposure Guide.
# ANSI PH2.7-1986. American National Standard for Photography --
#    Photographic Exposure Guide.
# CIPA DC-008-2010. Exchangeable image file format for digital still
#    cameras: Exif Version 2.3
# ISO 6:1993.  International Standard, Photography -- Black-and-white
#    pictorial still camera negative film/process systems --
#    Determination of ISO Speed.

!endcategory

#
# Astronomical time measurements
#
# Astronomical time measurement is a complicated matter.  The length of the
# true day at a given place can be 21 seconds less than 24 hours or 30 seconds
# over 24 hours.  The two main reasons for this are the varying speed of the
# earth in its elliptical orbit and the fact that the sun moves on the ecliptic
# instead of along the celestial equator.  To devise a workable system for time
# measurement, Simon Newcomb (1835-1909) used a fictitious "mean sun".
# Consider a first fictitious sun traveling along the ecliptic at a constant
# speed and coinciding with the true sun at perigee and apogee.  Then
# considering a second fictitious sun traveling along the celestial equator at
# a constant speed and coinciding with the first fictitious sun at the
# equinoxes.  The second fictitious sun is the "mean sun".  From this equations
# can be written out to determine the length of the mean day, and the tropical
# year.  The length of the second was determined based on the tropical year
# from such a calculation and was officially used from 1960-1967 until atomic
# clocks replaced astronomical measurements for a standard of time.  All of the
# values below give the mean time for the specified interval.
#
# See "Mathematical Astronomy Morsels" by Jean Meeus for more details
# and a description of how to compute the correction to mean time.
#

time                    ? second

anomalisticyear         365.2596 days       # The time between successive
                                            #   perihelion passages of the
                                            #   earth.
siderealyear            365.256360417 day   # The time for the earth to make
                                            #   one revolution around the sun
                                            #   relative to the stars.
tropicalyear            365.242198781 day   # The time needed for the mean sun
                                            #   as defined above to increase
                                            #   its longitude by 360 degrees.
                                            #   Most references defined the
                                            #   tropical year as the interval
                                            #   between vernal equinoxes, but
                                            #   this is misleading.  The length
                                            #   of the season changes over time
                                            #   because of the eccentricity of
                                            #   the earth's orbit.  The time
                                            #   between vernal equinoxes is
                                            #   approximately 365.24237 days
                                            #   around the year 2000.  See
                                            #   "Mathematical Astronomy
                                            #   Morsels" for more details.
eclipseyear             346.62 days         # The line of nodes is the
                                            #   intersection of the plane of
                                            #   Earth's orbit around the sun
                                            #   with the plane of the moon's
                                            #   orbit around earth.  Eclipses
                                            #   can only occur when the moon
                                            #   and sun are close to this
                                            #   line.  The line rotates and
                                            #   appearances of the sun on the
                                            #   line of nodes occur every
                                            #   eclipse year.
saros                   223 synodicmonth    # The earth, moon and sun appear in
                                            #   the same arrangement every
                                            #   saros, so if an eclipse occurs,
                                            #   then one saros later, a similar
                                            #   eclipse will occur.  (The saros
                                            #   is close to 19 eclipse years.)
                                            #   The eclipse will occur about
                                            #   120 degrees west of the
                                            #   preceeding one because the
                                            #   saros is not an even number of
                                            #   days.  After 3 saros, an
                                            #   eclipse will occur at
                                            #   approximately the same place.
siderealday             86164.09054 s       # The sidereal day is the interval
siderealhour            1|24 siderealday    #   between two successive transits
siderealminute          1|60 siderealhour   #   of a star over the meridian,
siderealsecond          1|60 siderealminute #   or the time required  for the
                                            #   earth to make one rotation
                                            #   relative to the stars.  The
                                            #   more usual solar day is the
                                            #   time required to make a
                                            #   rotation relative to the sun.
                                            #   Because the earth moves in its
                                            #   orbit, it has to turn a bit
                                            #   extra to face the sun again,
                                            #   hence the solar day is slightly
                                            #   longer.
anomalisticmonth        27.55454977 day     # Time for the moon to travel from
                                            #   perigee to perigee
nodicalmonth            27.2122199 day      # The nodes are the points where
draconicmonth           nodicalmonth        #   an orbit crosses the ecliptic.
draconiticmonth         nodicalmonth        #   This is the time required to
                                            #   travel from the ascending node
                                            #   to the next ascending node.
siderealmonth           27.321661 day       # Time required for the moon to
                                            #   orbit the earth
lunarmonth              29 days + 12 hours + 44 minutes + 2.8 seconds
                                            # Mean time between full moons.
synodicmonth            lunarmonth          #   Full moons occur when the sun
lunation                synodicmonth        #   and moon are on opposite sides
lune                    1|30 lunation       #   of the earth.  Since the earth
lunour                  1|24 lune           #   moves around the sun, the moon
                                            #   has to revolve a bit extra to
                                            #   get into the full moon
                                            #   configuration.
year                    tropicalyear
yr                      year
month                   1|12 year
mo                      month
lustrum                 5 years             # The Lustrum was a Roman
                                            #   purification ceremony that took
                                            #   place every five years.
                                            #   Classically educated Englishmen
                                            #   used this term.
decade                  10 years
century                 100 years
millennium              1000 years
millennia               millennium
solaryear               year
lunaryear               12 lunarmonth
calendaryear            365 day
commonyear              365 day
leapyear                366 day
julianyear              365.25 day
gregorianyear           365.2425 day
islamicyear             354 day          # A year of 12 lunar months. They
islamicleapyear         355 day          # began counting on July 16, AD 622
                                         # when Muhammad emigrated to Medina
                                         # (the year of the Hegira).  They need
                                         # 11 leap days in 30 years to stay in
                                         # sync with the lunar year which is a
                                         # bit longer than the 29.5 days of the
                                         # average month.  The months do not
                                         # keep to the same seasons, but
                                         # regress through the seasons every
                                         # 32.5 years.
islamicmonth            1|12 islamicyear # They have 29 day and 30 day months.

# The Hewbrew year is also based on lunar months, but synchronized to the solar
# calendar.  The months vary irregularly between 29 and 30 days in length, and
# the years likewise vary.  The regular year is 353, 354, or 355 days long.  To
# keep up with the solar calendar, a leap month of 30 days is inserted every
# 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years of a 19 year cycle.  This
# gives leap years that last 383, 384, or 385 days.

# Objects on the earth are charted relative to a perfect ellipsoid whose
# dimensions are specified by different organizations.  The ellipsoid is
# specified by an equatorial radius and a flattening value which defines the
# polar radius.  These values are the 1996 values given by the International
# Earth Rotation Service (IERS) whose reference documents can be found at
# http://maia.usno.navy.mil/

earthflattening         1|298.25642
earthradius_equatorial  6378136.49 m
earthradius_polar       (-earthflattening+1) earthradius_equatorial

landarea                148.847e6 km^2
oceanarea               361.254e6 km^2

moonradius              1738 km         # mean value
sunradius               6.96e8 m

# Many astronomical values can be measured most accurately in a system of units
# using the astronomical unit and the mass of the sun as base units.  The
# uncertainty in the gravitational constant makes conversion to SI units
# significantly less accurate.

# The astronomical unit was defined to be the length of the of the semimajor
# axis of a massless object with the same year as the earth.  With such a
# definition in force, and with the mass of the sun set equal to one, Kepler's
# third law can be used to solve for the value of the gravitational constant.

# Kepler's third law says that (2 pi / T)^2 a^3 = G M where T is the orbital
# period, a is the size of the semimajor axis, G is the gravitational constant
# and M is the mass.  With M = 1 and T and a chosen for the earth's orbit, we
# find sqrt(G) = (2 pi / T) sqrt(AU^3).  This constant is called the Gaussian
# gravitational constant, apparently because Gauss originally did the
# calculations.  However, when the original calculation was done, the value
# for the length of the earth's year was inaccurate.  The value used is called
# the Gaussian year.  Changing the astronomical unit to bring it into
# agreement with more accurate values for the year would have invalidated a
# lot of previous work, so instead the astronomical unit has been kept equal
# to this original value.  This is accomplished by using a standard value for
# the Gaussian gravitational constant.  This constant is called k.
# Many values below are from http://ssd.jpl.nasa.gov/?constants

gauss_k                 0.01720209895   # This beast has dimensions of
                                        # au^(3|2) / day and is exact.
gaussianyear      (2 pi / gauss_k) days # Year that corresponds to the Gaussian
                                        # gravitational constant. This is a
                                        # fictional year, and doesn't
                                        # correspond to any celestial event.
astronomicalunit         149597870700 m # IAU definition from 2012, exact
au                     astronomicalunit # ephemeris for the above described
                                        # astronomical unit.  (See the NASA
                                        # site listed above.)

#
# The Hartree system of atomic units, derived from fundamental units
# of mass (of electron), action (planck's constant), charge, and
# the coulomb constant.

!category atomic "Atomic Units"

# Fundamental units

atomicmass              electronmass
atomiccharge            electroncharge
atomicaction            hbar

# derived units (Warning: accuracy is lost from deriving them this way)

atomiclength            bohrradius
atomictime              hbar^3/coulombconst^2 atomicmass electroncharge^4 # Period of first
                                                                          # bohr orbit
atomicvelocity          atomiclength / atomictime
atomicenergy            hbar / atomictime
hartree                 atomicenergy

!endcategory

#
# These thermal units treat entropy as charge, from [5]
#

thermalcoulomb          J/K        # entropy
thermalampere           W/K        # entropy flow
thermalfarad            J/K^2
thermalohm              K^2/W      # thermal resistance
fourier                 thermalohm
thermalhenry            J K^2/W^2  # thermal inductance
thermalvolt             K          # thermal potential difference


#
# United States units
#

# linear measure

# The US Metric Law of 1866 legalized the metric system in the USA and
# defined the meter in terms of the British system with the exact
# 1 meter = 39.37 inches.  On April 5, 1893 Thomas Corwin Mendenhall,
# Superintendent of Weights and Measures, decided, in what has become
# known as the "Mendenhall Order" that the meter and kilogram would be the
# fundamental standards in the USA.  The definition from 1866 was turned
# around to give an exact definition of the yard as 3600|3937 meters This
# definition was used until July of 1959 when the definition was changed
# to bring the US and other English-speaking countries into agreement; the
# Canadian value of 1 yard = 0.9144 meter (exactly) was chosen because it
# was approximately halfway between the British and US values; it had the
# added advantage of making 1 inch = 25.4 mm (exactly).  Since 1959, the
# "international" foot has been exactly 0.3048 meters.  At the same time,
# it was decided that any data expressed in feet derived from geodetic
# surveys within the US would continue to use the old definition and call
# the old unit the "survey foot." The US continues to define the statute
# mile, furlong, chain, rod, link, and fathom in terms of the US survey
# foot.
# Sources:
# NIST Special Publication 447, Sects. 5, 7, and 8.
# NIST Handbook 44, 2011 ed., Appendix C.
# Canadian Journal of Physics, 1959, 37:(1) 84, 10.1139/p59-014.

# Survey measures

!category us_survey "US Survey Measures"

surveyfoot              1200|3937 m
surveyfeet              surveyfoot
surveyft                surveyfoot
surveyinch              1|12 surveyfoot
surveyinches            surveyinch
surveyin                surveyinch
surveyyard              3 surveyfoot
surveyyd                surveyyard
surveymile              5280 surveyfoot
surveymi                surveymile

!endcategory

# International measures

!category int_customary "International Customary Length Measures"

?? International yard and pound, since July 1, 1959.
inch                    2.54 cm
inches                  inch
in                      inch
?? International yard and pound, since July 1, 1959.
foot                    12 inch
feet                    foot
ft                      foot
?? International yard and pound, since July 1, 1959.
yard                    3 ft
yd                      yard
?? International yard and pound, since July 1, 1959.
mile                    5280 ft          # The mile was enlarged from 5000 ft
mi                      mile             # to this number in order to make
                                         # it an even number of furlongs.
                                         # (The Roman mile is 5000 romanfeet.)
line                    1|12 inch  # Also defined as '.1 in' or as '1e-8 Wb'
rod                     5.5 yard
perch                   rod
pole                    rod
furlong                 40 rod        # From "furrow long"
statutemile             mile
league                  3 mile

# aliases for international units

intinch                 inch
intinches               inch
intin                   in
intfoot                 foot
intfeet                 foot
intft                   foot
intyard                 yard
intyd                   yard
intmile                 mile
intmi                   mile
intline                 line
introd                  rod
intperch                perch
intfurlong              furlong
intleague               league

!endcategory

# surveyor's measure

!category us_survey "US Survey Measures"

surveyorschain          66 surveyft
surveychain             surveyorschain
gunterschain            surveyorschain
surveyorspole           1|4 surveyorschain
surveyorslink           1|100 surveyorschain
surveyacre              10 surveychain^2
surveyacrefoot          surveyacre surveyfoot

chain                   66 intfoot
link                    1|100 chain
acre                    10 chain^2       # Acre based on international ft
acrefoot                acre foot
ch                      chain

intchain                chain
intlink                 link
intacrefoot             acrefoot
intacre                 acre
section                 mile^2
township                36 section
homestead               160 acre # Area of land granted by the 1862 Homestead
                                 # Act of the United States Congress

engineerschain          100 ft
engineerslink           1|100 engineerschain
ramsdenschain           engineerschain
ramsdenslink            engineerslink

gurleychain             33 feet           # Andrew Ellicott chain is the
gurleylink              1|50 gurleychain  # same length

wingchain               66 feet           # Chain from 1664, introduced by
winglink                1|80 wingchain    # Vincent Wing, also found in a
                                          # 33 foot length with 40 links.

# early US length standards

# The US has had four standards for the yard: one by Troughton of London
# (1815); bronze yard #11 (1856); the Mendhall yard (1893), consistent
# with the definition of the meter in the metric joint resolution of
# Congress in 1866, but defining the yard in terms of the meter; and the
# international yard (1959), which standardized definitions for Australia,
# Canada, New Zealand, South Africa, the UK, and the US.
# Sources: Pat Naughtin (2009), Which Inch?, www.metricationmatters.com;
# Lewis E.  Barbrow and Lewis V.  Judson (1976).  NBS Special Publication
# 447, Weights and Measures Standards of the United States: A Brief
# History.

troughtonyard           914.42190 mm
bronzeyard11            914.39980 mm
mendenhallyard          surveyyard
internationalyard       yard

!endcategory

# international nautical measures

!category int_nautical "International Nautical Units"

intfathom               6 ft     # Originally defined as the distance from
                                 #   fingertip to fingertip with arms fully
                                 #   extended.
intnauticalmile         1852 m   # Supposed to be one minute of latitude at
                                 # the equator.  That value is about 1855 m.
                                 # Early estimates of the earth's circumference
                                 # were a bit off.  The value of 1852 m was
                                 # made the international standard in 1929.
                                 # The US did not accept this value until
                                 # 1954.  The UK switched in 1970.

fathom                  intfathom
nauticalmile            intnauticalmile
intcable                1|10 nauticalmile

cable                   intcable              # international cable
cablelength             cable

!endcategory

# survey nautical measures

!category us_nautical "US Survey Nautical Units"

surveynauticalmile      6080.20 surveyfoot # Before 1954
surveyfathom            6 surveyfoot
surveycable             100 surveyfathom
navycablelength         720 surveyft           # used for depth in water
marineleague            3 nauticalmile
geographicalmile        brnauticalmile
knot                    nauticalmile / hr
click                   km       # US military slang
klick                   click

!endcategory

# Avoirdupois weight

!category avoirdupois "Avoirdupois Weights"

?? International yard and pound, since July 1, 1959. Avoirdupois.
pound                   0.45359237 kg   # The one normally used
lb                      pound           # From the latin libra
grain                   1|7000 pound    # The grain is the same in all three
                                        # weight systems.  It was originally
                                        # defined as the weight of a barley
                                        # corn taken from the middle of the
                                        # ear.
ounce                   1|16 pound
oz                      ounce
dram                    1|16 ounce
dr                      dram
ushundredweight         100 pounds
cwt                     hundredweight
shorthundredweight      ushundredweight
uston                   shortton
shortton                2000 lb
quarterweight           1|4 uston
shortquarterweight      1|4 shortton
shortquarter            shortquarterweight

!endcategory

# Troy Weight.  In 1828 the troy pound was made the first United States
# standard weight.  It was to be used to regulate coinage.

!category troy "Troy Weights"

troypound               5760 grain
troyounce               1|12 troypound
ozt                     troyounce
pennyweight             1|20 troyounce  # Abbreviated "d" in reference to a
dwt                     pennyweight     #   Frankish coin called the "denier"
                                        #   minted in the late 700's.  There
                                        #   were 240 deniers to the pound.
assayton                mg ton / troyounce  # mg / assayton = troyounce / ton
usassayton              mg uston / troyounce
brassayton              mg brton / troyounce
fineounce               troyounce       # A troy ounce of 99.5% pure gold

!endcategory

# Some other jewelers units

!category jewelers "Jewelers' Units"

metriccarat             0.2 gram        # Defined in 1907
metricgrain             50 mg
carat                   metriccarat
ct                      carat
jewelerspoint           1|100 carat
silversmithpoint        1|4000 inch
momme                   3.75 grams      # Traditional Japanese unit based
                                        # on the chinese mace.  It is used for
                                        # pearls in modern times and also for
                                        # silk density.  The definition here
                                        # was adopted in 1891.

!endcategory

# Apothecaries' weight

!category apothecary "Apothecaries' Weights"

appound                 troypound
apounce                 troyounce
apdram                  1|8 apounce
apscruple               1|3 apdram

!endcategory

# Liquid measure

!category us_volume "US Volume Measures"

usgallon                231 in^3        # US liquid measure is derived from
gal                     gallon          # the British wine gallon of 1707.
quart                   1|4 gallon      # See the "winegallon" entry below
pint                    1|2 quart       # more historical information.
gill                    1|4 pint
usquart                 1|4 usgallon
uspint                  1|2 usquart
usgill                  1|4 uspint
usfluidounce            1|16 uspint
fluiddram               1|8 usfloz
minimvolume             1|60 fluiddram
qt                      quart
pt                      pint
floz                    fluidounce
usfloz                  usfluidounce
fldr                    fluiddram
liquidbarrel            31.5 usgallon
usbeerbarrel            2 beerkegs
beerkeg                 15.5 usgallon   # Various among brewers
ponykeg                 1|2 beerkeg
winekeg                 12 usgallon
petroleumbarrel         42 usgallon     # Originated in Pennsylvania oil
barrel                  petroleumbarrel # fields, from the winetierce
bbl                     barrel
ushogshead              2 liquidbarrel
usfirkin                9 usgallon

# Dry measures: The Winchester Bushel was defined by William III in 1702 and
# legally adopted in the US in 1836.

usbushel                2150.42 in^3  # Volume of 8 inch cylinder with 18.5
bu                      bushel        # inch diameter (rounded)
peck                    1|4 bushel
uspeck                  1|4 usbushel
brpeck                  1|4 brbushel
pk                      peck
drygallon               1|2 uspeck
dryquart                1|4 drygallon
drypint                 1|2 dryquart
drybarrel               7056 in^3     # Used in US for fruits, vegetables,
                                      #   and other dry commodities except for
                                      #   cranberries.
cranberrybarrel         5826 in^3     # US cranberry barrel
heapedbushel            1.278 usbushel# The following explanation for this
                                      #   value was provided by Wendy Krieger
                                      #   <os2fan2@yahoo.com> based on
                                      #   guesswork.  The cylindrical vessel is
                                      #   18.5 inches in diameter and 1|2 inch
                                      #   thick.  A heaped bushel includes the
                                      #   contents of this cylinder plus a heap
                                      #   on top.  The heap is a cone 19.5
                                      #   inches in diameter and 6 inches
                                      #   high.  With these values, the volume
                                      #   of the bushel is 684.5 pi in^3 and
                                      #   the heap occupies 190.125 pi in^3.
                                      #   Therefore, the heaped bushel is
                                      #   874.625|684.5 bushels.  This value is
                                      #   approximately 1.2777575 and it rounds
                                      #   to the value listed for the size of
                                      #   the heaped bushel.  Sometimes the
                                      #   heaped bushel is reported as 1.25
                                      #   bushels.  This same explanation gives
                                      #   that value if the heap is taken to
                                      #   have an 18.5 inch diameter.

!endcategory

# Grain measures.  The bushel as it is used by farmers in the USA is actually
# a measure of mass which varies for different commodities.  Canada uses the
# same bushel masses for most commodities, but not for oats.

!category us_grain "US Grain Measures"

wheatbushel             60 lb
soybeanbushel           60 lb
cornbushel              56 lb
ryebushel               56 lb
barleybushel            48 lb
oatbushel               32 lb
ricebushel              45 lb
canada_oatbushel        34 lb

!endcategory

# Wine and Spirits measure

!category wine "Wine and Spirits Measures"

ponyvolume              1 usfloz
jigger                  1.5 usfloz   # Can vary between 1 and 2 usfloz
shot                    jigger     # Sometimes 1 usfloz
eushot                  25 ml      # EU standard spirits measure
fifth                   1|5 usgallon
winebottle              750 ml     # US industry standard, 1979
winesplit               1|4 winebottle
wineglass               4 usfloz
magnum                  1.5 liter  # Standardized in 1979, but given
                                   # as 2 qt in some references
metrictenth             375 ml
metricfifth             750 ml
metricquart             1 liter

!endcategory

# Old British bottle size

!category br_bottles "British Bottle Sizes"

reputedquart            1|6 brgallon
reputedpint             1|2 reputedquart
brwinebottle            reputedquart       # Very close to 1|5 winegallon

!endcategory

# French champagne bottle sizes

!category fr_bottle "French CHampagne Bottle Sizes"

split                   200 ml
jeroboam                2 magnum
rehoboam                3 magnum
methuselah              4 magnum
salmanazar              6 magnum
balthazar               8 magnum
nebuchadnezzar          10 magnum

!endcategory

#
# Water is "hard" if it contains various minerals, expecially calcium
# carbonate.
#

!category water_hardness "Water Hardness Measures"

clarkdegree     grains/brgallon # Content by weigh of calcium carbonate
gpg             grains/usgallon # Divide by water's density to convert to
                                #   a dimensionless concentration measure

!endcategory

#
# Shoe measures
#

!category shoes "Shoe Measures"

shoeiron                1|48 inch    # Used to measure leather in soles
shoeounce               1|64 inch    # Used to measure non-sole shoe leather

# USA shoe sizes.  These express the length of the shoe or the length
# of the "last", the form that the shoe is made on.  But note that
# this only captures the length.  It appears that widths change 1/4
# inch for each letter within the same size, and if you change the
# length by half a size then the width changes between 1/8 inch and
# 1/4 inch.  But this may not be standard.  If you know better, please
# contact me.

shoesize_delta          1|3 inch     # USA shoe sizes differ by this amount
shoe_men0               8.25 inch
shoe_women0             (7+11|12) inch
shoe_boys0              (3+11|12) inch
shoe_girls0             (3+7|12) inch

#shoesize_men(n) units=[1;inch]   shoe_men0 + n shoesize_delta ; \
#                                (shoesize_men+(-shoe_men0))/shoesize_delta
#shoesize_women(n) units=[1;inch] shoe_women0 + n shoesize_delta ; \
#                                (shoesize_women+(-shoe_women0))/shoesize_delta
#shoesize_boys(n) units=[1;inch]  shoe_boys0 + n shoesize_delta ; \
#                                (shoesize_boys+(-shoe_boys0))/shoesize_delta
#shoesize_girls(n) units=[1;inch] shoe_girls0 + n shoesize_delta ; \
#                                (shoesize_girls+(-shoe_girls0))/shoesize_delta

# European shoe size.  According to
#      http://www.shoeline.com/footnotes/shoeterm.shtml
# shoe sizes in Europe are measured with Paris points which simply measure
# the length of the shoe.

europeshoesize          2|3 cm

!endcategory

#
# USA slang units
#

key                     kg           # usually of marijuana, 60's
lid                     1 oz         # Another 60's weed unit
footballfield           usfootballfield
usfootballfield         100 yards
canadafootballfield     110 yards    # And 65 yards wide
marathon                26 miles + 385 yards

#
# British
#

# The length measure in the UK was defined by a bronze bar manufactured in
# 1844.  Various conversions were sanctioned for convenience at different
# times, which makes conversions before 1963 a confusing matter.  Apparently
# previous conversions were never explicitly revoked.  Four different
# conversion factors appear below.  Multiply them times an imperial length
# units as desired.  The Weights and Measures Act of 1963 switched the UK away
# from their bronze standard and onto a definition of the yard in terms of the
# meter.  This happened after an international agreement in 1959 to align the
# world's measurement systems.

# In 1922, Seers, Jolly and
#   Johnson found the yard to be
#   0.91439841 meters.
#   Used starting in the 1930's.

!category br_length "British Length Measures"

UKSJJyard               0.91439841 meter
UKSJJfoot               1|3 UKSJJyard
UKSJJinch               1|12 UKSJJfoot
UKSJJmile               5280 UKSJJfoot

bryard                  UKSJJyard
brfoot                  UKSJJfoot
brinch                  UKSJJinch
brmile                  UKSJJmile

UKyard                  UKSJJyard
UKfoot                  UKSJJfoot
UKinch                  UKSJJinch
UKmile                  UKSJJmile
UKft                    UKfoot

# Benoit found the yard to be
#   0.9143992 m at a weights and
#   measures conference around
#   1896.   Legally sanctioned
#   in 1898.
UKByard                 0.9143992 meter
UKBfoot                 1|3 UKByard
UKBinch                 1|12 UKBfoot
UKBmile                 5280 UKBfoot

# In 1866 Clarke found the meter
#   to be 1.09362311 yards.  This
#   conversion was legalized
#   around 1878.
UKCyard                 1|1.09362311 meter
UKCfoot                 1|3 UKCyard
UKCinch                 1|12 UKCfoot
UKCmile                 5280 UKCfoot

# In 1816 Kater found this ratio
#   for the meter and inch.  This
#   value was used as the legal
#   conversion ratio when the
#   metric system was legalized
#   for contract in 1864.
UKKinch                 1|39.37079 meter
UKKfoot                 12 UKKinch
UKKyard                 3 UKKfoot
UKKmile                 5280 UKKfoot

brnauticalmile          6080 ft               # Used until 1970 when the UK
brknot                  brnauticalmile / hr   #   switched to the international
brcable                 1|10 brnauticalmile   #   nautical mile.
brstatutemile           5280 brfoot
english_land_league     3 brmile
brleague                english_land_league
admiraltymile           brnauticalmile
admiraltyknot           brknot
admiraltycable          brcable
seamile                 6000 ft
shackle                 15 fathoms            # Adopted 1949 by British navy

!endcategory

# British Imperial weight is mostly the same as US weight.  A few extra
# units are added here.

!category br_weight "British Weight Measures"

clove                   7 lb
stone                   14 lb
tod                     28 lb
brquarterweight         1|4 brhundredweight
brhundredweight         8 stone
longhundredweight       brhundredweight
longton                 20 brhundredweight
brton                   longton

!endcategory

# British Imperial volume measures

!category br_volume "British Volume Measures"

brminim                 1|60 brdram
brscruple               1|3 brdram
fluidscruple            brscruple
brdram                  1|8 brfloz
brfluidounce            1|20 brpint
brfloz                  brfluidounce
brgill                  1|4 brpint
brpint                  1|2 brquart
brquart                 1|4 brgallon
brgallon                4.54609 l      # The British Imperial gallon was
                                       # defined in 1824 to be the volume of
                                       # water which weighed 10 pounds at 62
                                       # deg F with a pressure of 30 inHg.
                                       # It was also defined as 277.274 in^3,
                                       # Which is slightly in error.  In
                                       # 1963 it was defined to be the volume
                                       # occupied by 10 pounds of distilled
                                       # water of density 0.998859 g/ml weighed
                                       # in air of density 0.001217 g/ml
                                       # against weights of density 8.136 g/ml.
                                       # This gives a value of approximately
                                       # 4.5459645 liters, but the old liter
                                       # was in force at this time.  In 1976
                                       # the definition was changed to exactly
                                       # 4.54609 liters using the new
                                       # definition of the liter (1 dm^3).
brbarrel                36 brgallon    # Used for beer
brbushel                8 brgallon
brheapedbushel          1.278 brbushel
brquarter               8 brbushel
brchaldron              36 brbushel

# Obscure British volume measures.  These units are generally traditional
# measures whose definitions have fluctuated over the years.  Often they
# depended on the quantity being measured.  They are given here in terms of
# British Imperial measures.  For example, the puncheon may have historically
# been defined relative to the wine gallon or beer gallon or ale gallon
# rather than the British Imperial gallon.

bag                     4 brbushel
bucket                  4 brgallon
kilderkin               2 brfirkin
last                    40 brbushel
noggin                  brgill
pottle                  0.5 brgallon
pin                     4.5 brgallon
puncheon                72 brgallon
seam                    8 brbushel
coomb                   4 brbushel
boll                    6 brbushel
firlot                  1|4 boll
brfirkin                9 brgallon     # Used for ale and beer
cran                    37.5 brgallon  # measures herring, about 750 fish
brwinehogshead          52.5 brgallon  # This value is approximately equal
brhogshead              brwinehogshead #   to the old wine hogshead of 63
                                       #   wine gallons.  This adjustment
                                       #   is listed in the OED and in
                                       #   "The Weights and Measures of
                                       #   England" by R. D. Connor
brbeerhogshead          54 brgallon
brbeerbutt              2 brbeerhogshead
registerton             100 ft^3  # Used for internal capacity of ships
shippington             40 ft^3   # Used for ship's cargo freight or timber
brshippington           42 ft^3   #
freightton            shippington # Both register ton and shipping ton derive
                                  # from the "tun cask" of wine.
displacementton         35 ft^3   # Approximate volume of a longton weight of
                                  # sea water.  Measures water displaced by
                                  # ships.
waterton                224 brgallon
strike                  70.5 l    # 16th century unit, sometimes
                                  #   defined as .5, 2, or 4 bushels
                                  #   depending on the location.  It
                                  #   probably doesn't make a lot of
                                  #   sense to define in terms of imperial
                                  #   bushels.  Zupko gives a value of
                                  #   2 Winchester grain bushels or about
                                  #   70.5 liters.
amber                   4 brbushel# Used for dry and liquid capacity [18]

# British volume measures with "imperial"

imperialminim           brminim
imperialscruple         brscruple
imperialdram            brdram
imperialfluidounce      brfluidounce
imperialfloz            brfloz
imperialgill            brgill
imperialpint            brpint
imperialquart           brquart
imperialgallon          brgallon
imperialbarrel          brbarrel
imperialbushel          brbushel
imperialheapedbushel    brheapedbushel
imperialquarter         brquarter
imperialchaldron        brchaldron
imperialwinehogshead    brwinehogshead
imperialhogshead        brhogshead
imperialbeerhogshead    brbeerhogshead
imperialbeerbutt        brbeerbutt
imperialfirkin          brfirkin

!endcategory

# obscure British lengths

!category br_length "British Length Measures"

barleycorn              1|3 UKinch   # Given in Realm of Measure as the
                                     # difference between successive shoe sizes
nail                    1|16 UKyard  # Originally the width of the thumbnail,
                                     #   or 1|16 ft.  This took on the general
                                     #   meaning of 1|16 and settled on the
                                     #   nail of a yard or 1|16 yards as its
                                     #   final value.  [12]
brpole                  16.5 UKft    # This was 15 Saxon feet, the Saxon
rope                    20 UKft      #   foot (aka northern foot) being longer
englishell              45 UKinch
flemishell              27 UKinch
ell                     englishell   # supposed to be measure from elbow to
                                     #   fingertips
span                    9 UKinch     # supposed to be distance from thumb
                                     #   to pinky with full hand extension
goad                    4.5 UKft     # used for cloth, possibly named after the
                                     #   stick used for prodding animals.

!endcategory

# misc obscure British units

hide                    120 acre  # English unit of land area dating to the 7th
                                  #   century, originally the amount of land
                                  #   that a single plowman could cultivate,
                                  #   which varied from 60-180 acres regionally.
                                  #   Standardized at Normon conquest.
virgate                 1|4 hide
nook                    1|2 virgate
rood                    furlong rod  # Area of a strip a rod by a furlong
englishcarat            troyounce/151.5 # Originally intended to be 4 grain
                                        #   but this value ended up being
                                        #   used in the London diamond market
mancus                  2 oz
mast                    2.5 lb
nailkeg                 100 lbs
basebox                 31360 in^2      # Used in metal plating

# alternate spellings

metre                   meter
gramme                  gram
litre                   liter
dioptre                 diopter
aluminium               aluminum
sulphur                 sulfur

#
# Units derived the human body (may not be very accurate)
#

!category human_measures "Human Body Measurements"

geometricpace           5 ft   # distance between points where the same
                               # foot hits the ground
pace                    2.5 ft # distance between points where alternate
                               # feet touch the ground
USmilitarypace          30 in  # United States official military pace
USdoubletimepace        36 in  # United States official doubletime pace
fingerbreadth           7|8 in # The finger is defined as either the width
fingerlength            4.5 in #   or length of the finger
finger                  fingerbreadth
palmwidth               hand   # The palm is a unit defined as either the width
palmlength              8 in   #   or the length of the hand
hand                    4 inch # width of hand
shaftment               6 inch # Distance from tip of outstretched thumb to the
                               #   opposite side of the palm of the hand.  The
                               #   ending -ment is from the old English word
                               #   for hand. [18]
smoot              5 ft + 7 in # Created as part of an MIT fraternity prank.
                               #   In 1958 Oliver Smoot was used to measure
                               #   the length of the Harvard Bridge, which was
                               #   marked off in smooth lengths.  These
                               #   markings have been maintained on the bridge
                               #   since then and repainted by subsequent
                               #   incoming fraternity members.  During a
                               #   bridge rennovation the new sidewalk was
                               #   scored every smooth rather than at the
                               #   customary 6 ft spacing.

!endcategory

#
# Cooking measures
#

!category us_volume "US Volume Measures"

# Common abbreviations

tbl                     tablespoon
tbsp                    tablespoon
tblsp                   tablespoon
Tb                      tablespoon
tsp                     teaspoon
saltspoon               1|4 tsp

# US measures

uscup                   8 usfloz
ustablespoon            1|16 uscup
usteaspoon              1|3 ustablespoon
ustbl                   ustablespoon
ustbsp                  ustablespoon
ustblsp                 ustablespoon
ustsp                   usteaspoon
metriccup               250 ml
stickbutter             1|4 lb            # Butter in the USA is sold in one
                                          # pound packages that contain four
                                          # individually wrapped pieces.  The
                                          # pieces are marked into tablespoons,
                                          # making it possible to measure out
                                          # butter by volume by slicing the
                                          # butter.

legalcup                240 ml            # The cup used on nutrition labeling
legaltablespoon         1|16 legalcup
legaltbsp               legaltablespoon

# Scoop size.  Ice cream scoops in the US are marked with numbers
# indicating the number of scoops requird to fill a US quart.

#scoop(n)  units=[1;cup] domain=[4,100] range=[0.04,1] \
#           32 usfloz / n ; 32 usfloz / scoop


# US can sizes.

number1can              10 usfloz
number2can              19 usfloz
number2.5can            3.5 uscups
number3can              4 uscups
number5can              7 uscups
number10can             105 usfloz

!endcategory

# British measures

!category br_volume "British Volume Measures"

brcup                   1|2 brpint
brteacup                1|3 brpint
brtablespoon            15 ml             # Also 5|8 brfloz, approx 17.7 ml
brteaspoon              1|3 brtablespoon  # Also 1|4 brtablespoon
brdessertspoon          2 brteaspoon
dessertspoon            brdessertspoon
dsp                     dessertspoon
brtsp                   brteaspoon
brtbl                   brtablespoon
brtbsp                  brtablespoon
brtblsp                 brtablespoon

!endcategory

# Australian

!category au_volume "Australian Volume Measures"

australiatablespoon     20 ml
austbl                  australiatablespoon
austbsp                 australiatablespoon
austblsp                australiatablespoon
australiateaspoon       1|4 australiatablespoon
austsp                  australiateaspoon

!endcategory

# Italian

etto                    100 g          # Used for buying items like meat and
etti                    etto           #   cheese.

# Chinese

catty                   0.5 kg
oldcatty                4|3 lbs        # Before metric conversion.
tael                    1|16 oldcatty  # Should the tael be defined both ways?
mace                    0.1 tael
oldpicul                100 oldcatty
picul                   100 catty      # Chinese usage

# Indian

seer                    14400 grain    # British Colonial standard
ser                     seer
maund                   40 seer
pakistanseer            1 kg
pakistanmaund           40 pakistanseer
chittak                 1|16 seer
tola                    1|5 chittak
ollock                  1|4 liter      # Is this right?

# Japanese

japancup                200 ml

#
# Density measures.  Density has traditionally been measured on a variety of
# bizarre nonlinear scales.
#

# Density of a sugar syrup is frequently measured in candy making procedures.
# In the USA the boiling point of the syrup is measured.  Some recipes instead
# specify the density using degrees Baume.  Conversion between degrees Baume
# and the boiling point measure has proved elusive.  This table appeared in one
# text, and provides a fragmentary relationship to the concentration.
#
# temp(C)  conc (%)
#   100      30
#   101      40
#   102      50
#   103      60
#   106      70
#   112      80
#   123      90
#   140      95
#   151      97
#   160      98.2
#   166      99.5
#   171      99.6
#
# The best source identified to date came from "Boiling point elevation of
# technical sugarcane solutions and its use in automatic pan boiling" by
# Michael Saska.  International Sugar Journal, 2002, 104, 1247, pp 500-507.
#
# But I'm using equation (3) which is credited to Starzak and Peacock,
# "Water activity coefficient in aqueous solutions of sucrose--A comprehensive
# data analyzis.  Zuckerindustrie, 122, 380-387.  (I couldn't find this
# document.)
#
# Note that the range of validity is uncertain, but answers are in agreement
# with the above table all the way to 99.6.
#
# The original equation has a parameter for the boiling point of water, which
# of course varies with altitude.  It also includes various other model
# parameters.  The input is the molar concentration of sucrose in the solution,
# (moles sucrose) / (total moles).
#
# Bsp 3797.06 degC
# Csp 226.28 degC
# QQ -17638 J/mol
# asp -1.0038
# bsp -0.24653
# tbw 100 degC     # boiling point of water
# sugar_bpe_orig(x) ((1-QQ/R Bsp * x^2 (1+asp x + bsp x^2) (tbw + Csp) \
#           /(tbw+stdtemp)) /  (1+(tbw + Csp)/Bsp *ln(1-x))-1) * (tbw + Csp)
#
# To convert mass concentration (brix) to molar concentration
#
# sc(x)  (x / 342.3) / (( x/342.3) + (100-x)/18.02); \
#        100 sc 342.3|18.02 / (sc (342.3|18.02-1)+1)
#
# Here is a simplfied version of this equation where the temperature of boiling
# water has been fixed at 100 degrees Celcius and the argument is now the
# concentration (brix).
#
# sugar_bpe(x) ((1+ 0.48851085 * sc(x)^2 (1+ -1.0038 sc(x) + -0.24653 sc(x)^2)) \
#                   / (1+0.08592964 ln(1-sc(x)))-1) 326.28 K
#
#
# The formula is not invertible, so to implement it in units we unfortunately
# must turn it into a table.

# This table gives the boiling point elevation as a function of the sugar syrup
# concentration expressed as a percentage.

#sugar_conc_bpe[K] \
# 0 0.0000   5 0.0788  10 0.1690  15 0.2729  20 0.3936  25 0.5351  \
#30 0.7027  35 0.9036  40 1.1475  42 1.2599  44 1.3825  46 1.5165  \
#48 1.6634  50 1.8249  52 2.0031  54 2.2005  56 2.4200  58 2.6651  \
#60 2.9400  61 3.0902  62 3.2499  63 3.4198  64 3.6010  65 3.7944  \
#66 4.0012  67 4.2227  68 4.4603  69 4.7156  70 4.9905  71 5.2870  \
#72 5.6075  73 5.9546  74 6.3316  75 6.7417  76 7.1892  77 7.6786  \
#78.0  8.2155  79.0  8.8061  80.0  9.4578  80.5  9.8092  81.0 10.1793  \
#81.5 10.5693  82.0 10.9807  82.5 11.4152  83.0 11.8743  83.5 12.3601  \
#84.0 12.8744  84.5 13.4197  85.0 13.9982  85.5 14.6128  86.0 15.2663  \
#86.5 15.9620  87.0 16.7033  87.5 17.4943  88.0 18.3391  88.5 19.2424  \
#89.0 20.2092  89.5 21.2452  90.0 22.3564  90.5 23.5493  91.0 24.8309  \
#91.5 26.2086  92.0 27.6903  92.5 29.2839  93.0 30.9972  93.5 32.8374  \
#94.0 34.8104  94.5 36.9195  95.0 39.1636  95.5 41.5348  96.0 44.0142  \
#96.5 46.5668  97.0 49.1350  97.5 51.6347  98.0 53.9681  98.1 54.4091  \
#98.2 54.8423  98.3 55.2692  98.4 55.6928  98.5 56.1174  98.6 56.5497  \
#98.7 56.9999  98.8 57.4828  98.9 58.0206  99.0 58.6455  99.1 59.4062  \
#99.2 60.3763  99.3 61.6706  99.4 63.4751  99.5 66.1062  99.6 70.1448  \
#99.7 76.7867

# Using the brix table we can use this to produce a mapping from boiling point
# to density which makes all of the units interconvertible.  Because the brix
# table stops at 95 this approach works up to a boiling point elevation of 39 K
# or a boiling point of 139 C / 282 F, which is the "soft crack" stage in candy
# making.  The "hard crack" stage continues up to 310 F.

# Boiling point elevation
#sugar_bpe(T) units=[K;g/cm^3] domain=[0,39.1636] range=[0.99717,1.5144619] \
#               brix(~sugar_conc_bpe(T)); sugar_conc_bpe(~brix(sugar_bpe))
# Absolute boiling point (produces an absolute temperature)
#sugar_bp(T) units=[K;g/cm^3] domain=[373.15,412.3136] \
#                                         range=[0.99717,1.5144619] \
#                        brix(~sugar_conc_bpe(T-tempC(100))) ;\
#                        sugar_conc_bpe(~brix(sugar_bp))+tempC(100)

# In practice dealing with the absolute temperature is annoying because it is
# not possible to convert to a nested function, so you're stuck retyping the
# absolute temperature in Kelvins to convert to celsius or Fahrenheit.  To
# prevent this we supply definitions that build in the temperature conversion
# and produce results in the Fahrenheit and Celcius scales.  So using these
# measures, to convert 46 degrees Baume to a Fahrenheit boiling point:
#
#      You have: baume(45)
#      You want: sugar_bpF
#              239.05647
#
#sugar_bpF(T) units=[1;g/cm^3] domain=[212,282.49448] range=[0.99717,1.5144619]\
#                        brix(~sugar_conc_bpe(tempF(T)+-tempC(100))) ;\
#                        ~tempF(sugar_conc_bpe(~brix(sugar_bpF))+tempC(100))
#sugar_bpC(T) units=[1;g/cm^3] domain=[100,139.1636] range=[0.99717,1.5144619]\
#                        brix(~sugar_conc_bpe(tempC(T)+-tempC(100))) ;\
#                        ~tempC(sugar_conc_bpe(~brix(sugar_bpC))+tempC(100))

# Degrees Baume is used in European recipes to specify the density of a sugar
# syrup.  An entirely different definition is used for densities below
# 1 g/cm^3.  An arbitrary constant appears in the definition.  This value is
# equal to 145 in the US, but was according to [], the old scale used in
# Holland had a value of 144, and the new scale or Gerlach scale used 146.78.

baumeconst 145      # US value
#baume(d) units=[1;g/cm^3] domain=[0,145) range=[1,) \
#                          (baumeconst/(baumeconst+-d)) g/cm^3 ; \
#                          (baume+((-g)/cm^3)) baumeconst / baume

# It's not clear if this value was ever used with negative degrees.
#twaddell(x) units=[1;g/cm^3] domain=[-200,) range=[0,) \
#                             (1 + 0.005 x) g / cm^3 ; \
#                             200 (twaddell / (g/cm^3) +- 1)

# The degree quevenne is a unit for measuring the density of milk.
# Similarly it's unclear if negative values were allowed here.
#quevenne(x) units=[1;g/cm^3] domain=[-1000,) range=[0,) \
#                             (1 + 0.001 x) g / cm^3 ; \
#                             1000 (quevenne / (g/cm^3) +- 1)

# Degrees brix measures sugar concentration by weigh as a percentage, so a
# solution that is 3 degrees brix is 3% sugar by weight.  This unit was named
# after Adolf Brix who invented a hydrometer that read this percentage
# directly.  This data is from Table 114 of NIST Circular 440, "Polarimetry,
# Saccharimetry and the Sugars".  It gives apparent specific gravity at 20
# degrees Celsius of various sugar concentrations.  As rendered below this
# data is converted to apparent density at 20 degrees Celsius using the
# density figure for water given in the same NIST reference.  They use the
# word "apparent" to refer to measurements being made in air with brass
# weights rather than vacuum.

#brix[0.99717g/cm^3]\
#    0 1.00000  1 1.00390  2 1.00780  3 1.01173  4 1.01569  5 1.01968 \
#    6 1.02369  7 1.02773  8 1.03180  9 1.03590 10 1.04003 11 1.04418 \
#   12 1.04837 13 1.05259 14 1.05683 15 1.06111 16 1.06542 17 1.06976 \
#   18 1.07413 19 1.07853 20 1.08297 21 1.08744 22 1.09194 23 1.09647 \
#   24 1.10104 25 1.10564 26 1.11027 27 1.11493 28 1.11963 29 1.12436 \
#   30 1.12913 31 1.13394 32 1.13877 33 1.14364 34 1.14855 35 1.15350 \
#   36 1.15847 37 1.16349 38 1.16853 39 1.17362 40 1.17874 41 1.18390 \
#   42 1.18910 43 1.19434 44 1.19961 45 1.20491 46 1.21026 47 1.21564 \
#   48 1.22106 49 1.22652 50 1.23202 51 1.23756 52 1.24313 53 1.24874 \
#   54 1.25439 55 1.26007 56 1.26580 57 1.27156 58 1.27736 59 1.28320 \
#   60 1.28909 61 1.29498 62 1.30093 63 1.30694 64 1.31297 65 1.31905 \
#   66 1.32516 67 1.33129 68 1.33748 69 1.34371 70 1.34997 71 1.35627 \
#   72 1.36261 73 1.36900 74 1.37541 75 1.38187 76 1.38835 77 1.39489 \
#   78 1.40146 79 1.40806 80 1.41471 81 1.42138 82 1.42810 83 1.43486 \
#   84 1.44165 85 1.44848 86 1.45535 87 1.46225 88 1.46919 89 1.47616 \
#   90 1.48317 91 1.49022 92 1.49730 93 1.50442 94 1.51157 95 1.51876

# Density measure invented by the American Petroleum Institute.  Lighter
# petroleum products are more valuable, and they get a higher API degree.
#
# The intervals of range and domain should be open rather than closed.
#
#apidegree(x) units=[1;g/cm^3] domain=[-131.5,) range=[0,) \
#                              141.5 g/cm^3 / (x+131.5) ; \
#                              141.5 (g/cm^3) / apidegree + (-131.5)

#
# Units derived from imperial system
#

!category derived_customary "Derived Customary Units"

ouncedal                oz ft / s^2     # force which accelerates an ounce
                                        #    at 1 ft/s^2
poundal                 lb ft / s^2     # same thing for a pound
tondal                  longton ft / s^2    # and for a ton
pdl                     poundal
osi                     ounce force / inch^2   # used in aviation
psi                     pound force / inch^2
psia                    psi             # absolute pressure
					#   Note that gauge pressure can be given
					#   using the gaugepressure() and
					#   psig() nonlinear unit definitions
tsi                     ton force / inch^2
reyn                    psi sec
slug                    lbf s^2 / ft
slugf                   slug force
slinch                  lbf s^2 / inch  # Mass unit derived from inch second
slinchf                 slinch force    #   pound-force system.  Used in space
                                        #   applications where in/sec^2 was a
                                        #   natural acceleration measure.
geepound                slug
lbf                     lb force
tonf                    ton force
lbm                     lb
kip                     1000 lbf     # from kilopound
ksi                     kip / in^2
mil                     0.001 inch
thou                    0.001 inch
tenth                   0.0001 inch  # one tenth of one thousandth of an inch
millionth               1e-6 inch    # one millionth of an inch
circularinch            1|4 pi in^2  # area of a one-inch diameter circle
circleinch              circularinch #    A circle with diameter d inches has
                                     #    an area of d^2 circularinches
cylinderinch         circleinch inch # Cylinder h inch tall, d inches diameter
                                     #    has volume d^2 h cylinder inches
circularmil             1|4 pi mil^2 # area of one-mil diameter circle
cmil                    circularmil

cental                  100 pound
centner                 cental
caliber                 0.01 inch    # for measuring bullets
duty                    ft lbf
celo                    ft / s^2
jerk                    ft / s^3
australiapoint          0.01 inch    # The "point" is used to measure rainfall
                                     #   in Australia
sabin                   ft^2         # Measure of sound absorption equal to the
                                     #   absorbing power of one square foot of
                                     #   a perfectly absorbing material.  The
                                     #   sound absorptivity of an object is the
                                     #   area times a dimensionless
                                     #   absorptivity coefficient.
standardgauge          4 ft + 8.5 in # Standard width between railroad track
flag                   5 ft^2        # Construction term referring to sidewalk.
rollwallpaper          30 ft^2       # Area of roll of wall paper
fillpower              in^3 / ounce  # Density of down at standard pressure.
                                     #   The best down has 750-800 fillpower.
pinlength              1|16 inch     # A #17 pin is 17/16 in long in the USA.
buttonline             1|40 inch     # The line was used in 19th century USA
                                     #   to measure width of buttons.
beespace               1|4 inch      # Bees will fill any space that is smaller
                                     #   than the bee space and leave open
                                     #   spaces that are larger.  The size of
                                     #   the space varies with species.
tapediamond            8|5 ft        # Marking on US tape measures that is
                                     #   useful to carpenters who wish to place
                                     #   five studs in an 8 ft distance.  Note
                                     #   that the numbers appear in red every
                                     #   16 inches as well, giving six
                                     #   divisions in 8 feet.
retmaunit              1.75 in       # Height of rack mountable equipment.
U                      retmaunit     #   Equipment should be 1|32 inch narrower
RU                     U             #   than its U measurement indicates to
                                     #   allow for clearance, so 4U=(6+31|32)in
                                     #   RETMA stands for the former name of
                                     #   the standardizing organization, Radio
                                     #   Electronics Television Manufacturers
                                     #   Association.  This organization is now
                                     #   called the Electronic Industries
                                     #   Alliance (EIA) and the rack standard
                                     #   is specified in EIA RS-310-D.
count                  /pound        # For measuring the size of shrimp

!endcategory

#
# Other units of work, energy, power, etc
#

energy                  ? joule

# Calories: energy to raise a gram of water one degree celsius

!category calories "Calories"

cal_IT                  4.1868 J     # International Table calorie
cal_th                  4.184 J      # Thermochemical calorie
cal_fifteen             4.18580 J    # Energy to go from 14.5 to 15.5 degC
cal_twenty              4.18190 J    # Energy to go from 19.5 to 20.5 degC
cal_mean                4.19002 J    # 1|100 energy to go from 0 to 100 degC
calorie                 cal_IT
cal                     calorie
calorie_IT              cal_IT
thermcalorie            cal_th
calorie_th              thermcalorie
Calorie                 kilocalorie  # the food Calorie
thermie              1e6 cal_fifteen # Heat required to raise the
                                     # temperature of a tonne of
                                     # water from 14.5 to 15.5 degC.

!endcategory

# btu definitions: energy to raise a pound of water 1 degF

btu                     cal lb degR / gram K # international table BTU
britishthermalunit      btu
btu_IT                  btu
btu_th                  cal_th lb degR / gram K
btu_mean                cal_mean lb degR / gram K
quad                    quadrillion btu

ECtherm                 1.05506e8 J    # Exact definition, close to 1e5 btu
UStherm                 1.054804e8 J   # Exact definition
therm                   UStherm

# Celsius heat unit: energy to raise a pound of water 1 degC

celsiusheatunit         cal lb K / gram K
chu                     celsiusheatunit

power                   ? watt

# "Apparent" average power in an AC circuit, the product of rms voltage
# and rms current, equal to the true power in watts when voltage and
# current are in phase.  In a DC circuit, always equal to the true power.

VA                      volt ampere

kWh                     kilowatt hour

# The horsepower is supposedly the power of one horse pulling.   Obviously
# different people had different horses.

!category horses "Horse Units"

horsepower              550 foot pound force / sec    # Invented by James Watt
mechanicalhorsepower    horsepower
hp                      horsepower
metrichorsepower        75 kilogram force meter / sec # PS=Pferdestaerke in
electrichorsepower      746 W                         # Germany
boilerhorsepower        9809.50 W
waterhorsepower         746.043 W
brhorsepower            745.70 W
donkeypower             250 W
chevalvapeur            metrichorsepower

!endcategory

#
# Heat Transfer
#
# Thermal conductivity, K, measures the rate of heat transfer across
# a material.  The heat transfered is
#     Q = K dT A t / L
# where dT is the temperature difference across the material, A is the
# cross sectional area, t is the time, and L is the length (thickness).
# Thermal conductivity is a material property.

thermal_conductivity    ? power / area (temperature_difference/length)
thermal_resistivity     ? 1/thermal_conductivity

# Thermal conductance is the rate at which heat flows across a given
# object, so the area and thickness have been fixed.  It depends on
# the size of the object and is hence not a material property.

thermal_conductance     ? power / temperature_difference
thermal_resistance      ? 1/thermal_conductance

# Thermal admittance is the rate of heat flow per area across an
# object whose thickness has been fixed.  Its reciprocal, thermal
# insulation, is used to for measuring the heat transfer per area
# of sheets of insulation or cloth that are of specified thickness.

thermal_admittance      ? thermal_conductivity / length
thermal_insulance         thermal_resistivity length
thermal_insulation      ? thermal_resistivity length

Rvalue                  degR ft^2 hr / btu
Uvalue                  1/Rvalue
europeanUvalue          watt / m^2 K
RSI                     K m^2 / W
clo                     0.155 K m^2 / W # Supposed to be the insulance
                                           # required to keep a resting person
                                           # comfortable indoors.  The value
                                           # given is from NIST and the CRC,
                                           # but [5] gives a slightly different
                                           # value of 0.875 ft^2 degF hr / btu.
tog                     0.1 K m^2 / W   # Also used for clothing.


# The bel was defined by engineers of Bell Laboratories to describe the
# reduction in audio level over a length of one mile. It was originally
# called the transmission unit (TU) but was renamed around 1923 to honor
# Alexander Graham Bell. The bel proved inconveniently large so the decibel
# has become more common.  The decibel is dimensionless since it reports a
# ratio, but it is used in various contexts to report a signal's power
# relative to some reference level.

#bel(x)     units=[1;1] range=(0,) 10^(x);    log(bel)    # Basic bel definition
#decibel(x) units=[1;1] range=(0,) 10^(x/10); 10 log(decibel) # Basic decibel
#dB()       decibel                                           # Abbreviation
#dBW(x)     units=[1;W] range=(0,) dB(x) W ;  ~dB(dBW/W)      # Reference = 1 W
#dBk(x)     units=[1;W] range=(0,) dB(x) kW ; ~dB(dBk/kW)     # Reference = 1 kW
#dBf(x)     units=[1;W] range=(0,) dB(x) fW ; ~dB(dBf/fW)     # Reference = 1 fW
#dBm(x)     units=[1;W] range=(0,) dB(x) mW ; ~dB(dBm/mW)     # Reference = 1 mW
#dBmW(x)    units=[1;W] range=(0,) dBm(x) ;   ~dBm(dBmW)      # Reference = 1 mW
#dBJ(x)     units=[1;J] range=(0,) dB(x) J; ~dB(dBJ/J)        # Energy relative
                                     # to 1 joule.  Used for power spectral
                                     # density since W/Hz = J

# When used to measure amplitude, voltage, or current the signal is squared
# because power is proportional to the square of these measures.  The root
# mean square (RMS) voltage is typically used with these units.

#dBV(x)  units=[1;V] range=(0,) dB(0.5 x) V;~dB(dBV^2 / V^2) # Reference = 1 V
#dBmV(x) units=[1;V] range=(0,) dB(0.5 x) mV;~dB(dBmV^2/mV^2)# Reference = 1 mV
#dBuV(x) units=[1;V] range=(0,) dB(0.5 x) microV ; ~dB(dBuV^2 / microV^2)
                                   # Reference = 1 microvolt

# Referenced to the voltage that causes 1 mW dissipation in a 600 ohm load.
# Originally defined as dBv but changed to prevent confusion with dBV.
# The "u" is for unloaded.
#dBu(x) units=[1;V] range=(0,) dB(0.5 x) sqrt(mW 600 ohm) ; \
#                              ~dB(dBu^2 / mW 600 ohm)
#dBv(x) units=[1;V] range=(0,) dBu(x) ; ~dBu(dBv)  # Synonym for dBu


# Measurements for sound in air, referenced to the threshold of human hearing
# Note that sound in other media typically uses 1 micropascal as a reference
# for sound pressure.  Units dBA, dBB, dBC, refer to different frequency
# weightings meant to approximate the human ear's response.

#dBSPL(x) units=[1;Pa] range=(0,) dB(0.5 x) 20 microPa ;  \
#                                 ~dB(dBSPL^2 / (20 microPa)^2) # pressure
#dBSIL(x) units=[1;W/m^2] range=(0,) dB(x) 1e-12 W/m^2; \
#                                    ~dB(dBSIL / (1e-12 W/m^2)) # intensity
#dBSWL(x) units=[1;W] range=(0,) dB(x) 1e-12 W; ~dB(dBSWL/1e-12 W)


# Misc other measures

clausius                1e3 cal/K       # A unit of physical entropy
langley                 thermcalorie/cm^2    # Used in radiation theory
poncelet                100 kg force m / s
tonrefrigeration        uston 144 btu / lb day # One ton refrigeration is
                                        # the rate of heat extraction required
                                        # turn one ton of water to ice in
                                        # a day.  Ice is defined to have a
                                        # latent heat of 144 btu/lb.
tonref                  tonrefrigeration
refrigeration           tonref / ton
frigorie                1000 cal_fifteen# Used in refrigeration engineering.
tnt                     1e9 cal_th / ton# So you can write tons tnt. This
                                        # is a defined, not measured, value.
airwatt                 8.5 (ft^3/min) inH2O # Measure of vacuum power as
                                             # pressure times air flow.

#
# Permeability: The permeability or permeance, n, of a substance determines
# how fast vapor flows through the substance.  The formula W = n A dP
# holds where W is the rate of flow (in mass/time), n is the permeability,
# A is the area of the flow path, and dP is the vapor pressure difference.
#

perm_0C                 grain / hr ft^2 inHg
perm_zero               perm_0C
perm_0                  perm_0C
perm                    perm_0C
perm_23C                grain / hr ft^2 in pressure_column_23C of Hg
perm_twentythree        perm_23C

#
# Counting measures
#

pair                    2
brace                   2
nest                    3     # often used for items like bowls that
                              #   nest together
hattrick                3     # Used in sports, especially cricket and ice
                              #   hockey to report the number of goals.
dicker                  10
dozen                   12
bakersdozen             13
score                   20
flock                   40
timer                   40
shock                   60
toncount                100   # Used in sports in the UK
longhundred             120   # From a germanic counting system
gross                   144
greatgross              12 gross
tithe                   1|10  # From Anglo-Saxon word for tenth

# Paper counting measure

shortquire              24
quire                   25
shortream               480
ream                    500
perfectream             516
bundle                  2 reams
bale                    5 bundles

#
# Paper measures
#

!category paper "Paper Sizes"

# USA paper sizes

lettersize              8.5 inch 11 inch
legalsize               8.5 inch 14 inch
ledgersize              11 inch 17 inch
executivesize           7.25 inch 10.5 inch
Apaper                  8.5 inch 11 inch
Bpaper                  11 inch 17 inch
Cpaper                  17 inch 22 inch
Dpaper                  22 inch 34 inch
Epaper                  34 inch 44 inch

# Correspondence envelope sizes.  #10 is the standard business
# envelope in the USA.

envelope6_25size        3.5 inch 6 inch
envelope6_75size        3.625 inch 6.5 inch
envelope7size           3.75 inch 6.75 inch
envelope7_75size        3.875 inch 7.5 inch
envelope8_625size       3.625 inch 8.625 inch
envelope9size           3.875 inch 8.875 inch
envelope10size          4.125 inch 9.5 inch
envelope11size          4.5 inch 10.375 inch
envelope12size          4.75 inch 11 inch
envelope14size          5 inch 11.5 inch
envelope16size          6 inch 12 inch

# Announcement envelope sizes (no relation to metric paper sizes like A4)

envelopeA1size          3.625 inch 5.125 inch  # same as 4bar
envelopeA2size          4.375 inch 5.75 inch
envelopeA6size          4.75 inch 6.5 inch
envelopeA7size          5.25 inch 7.25 inch
envelopeA8size          5.5 inch 8.125 inch
envelopeA9size          5.75 inch 8.75 inch
envelopeA10size         6 inch 9.5 inch

# Baronial envelopes

envelope4bar            3.625 inch 5.125 inch  # same as A1
envelope5_5bar          4.375 inch 5.75 inch
envelope6bar            4.75 inch 6.5 inch

# Coin envelopes

envelope1baby           2.25 inch 3.5 inch     # same as #1 coin
envelope00coin          1.6875 inch 2.75 inch
envelope1coin           2.25 inch 3.5 inch
envelope3coin           2.5 inch 4.25 inch
envelope4coin           3 inch 4.5 inch
envelope4_5coin         3 inch 4.875 inch
envelope5coin           2.875 inch 5.25 inch
envelope5_5coin         3.125 inch 5.5 inch
envelope6coin           3.375 inch 6 inch
envelope7coin           3.5 inch 6.5 inch

# The metric paper sizes are defined so that if a sheet is cut in half
# along the short direction, the result is two sheets which are
# similar to the original sheet.  This means that for any metric size,
# the long side is close to sqrt(2) times the length of the short
# side.  Each series of sizes is generated by repeated cuts in half,
# with the values rounded down to the nearest millimeter.

A0paper                 841 mm 1189 mm   # The basic size in the A series
A1paper                 594 mm  841 mm   # is defined to have an area of
A2paper                 420 mm  594 mm   # one square meter.
A3paper                 297 mm  420 mm
A4paper                 210 mm  297 mm
A5paper                 148 mm  210 mm
A6paper                 105 mm  148 mm
A7paper                  74 mm  105 mm
A8paper                  52 mm   74 mm
A9paper                  37 mm   52 mm
A10paper                 26 mm   37 mm

B0paper                1000 mm 1414 mm   # The basic B size has an area
B1paper                 707 mm 1000 mm   # of sqrt(2) square meters.
B2paper                 500 mm  707 mm
B3paper                 353 mm  500 mm
B4paper                 250 mm  353 mm
B5paper                 176 mm  250 mm
B6paper                 125 mm  176 mm
B7paper                  88 mm  125 mm
B8paper                  62 mm   88 mm
B9paper                  44 mm   62 mm
B10paper                 31 mm   44 mm

C0paper                 917 mm 1297 mm   # The basic C size has an area
C1paper                 648 mm  917 mm   # of sqrt(sqrt(2)) square meters.
C2paper                 458 mm  648 mm
C3paper                 324 mm  458 mm   # Intended for envelope sizes
C4paper                 229 mm  324 mm
C5paper                 162 mm  229 mm
C6paper                 114 mm  162 mm
C7paper                  81 mm  114 mm
C8paper                  57 mm   81 mm
C9paper                  40 mm   57 mm
C10paper                 28 mm   40 mm

# gsm (Grams per Square Meter), a sane, metric paper weight measure

gsm                     grams / meter^2

# In the USA, a collection of crazy historical paper measures are used.  Paper
# is measured as a weight of a ream of that particular type of paper.  This is
# sometimes called the "substance" or "basis" (as in "substance 20" paper).
# The standard sheet size or "basis size" varies depending on the type of
# paper.  As a result, 20 pound bond paper and 50 pound text paper are actually
# about the same weight.  The different sheet sizes were historically the most
# convenient for printing or folding in the different applications.  These
# different basis weights are standards maintained by American Society for
# Testing Materials (ASTM) and the American Forest and Paper Association
# (AF&PA).

poundbookpaper          lb / 25 inch 38 inch ream
lbbook                  poundbookpaper
poundtextpaper          poundbookpaper
lbtext                  poundtextpaper
poundoffsetpaper        poundbookpaper    # For offset printing
lboffset                poundoffsetpaper
poundbiblepaper         poundbookpaper    # Designed to be lightweight, thin,
lbbible                 poundbiblepaper   # strong and opaque.
poundtagpaper           lb / 24 inch 36 inch ream
lbtag                   poundtagpaper
poundbagpaper           poundtagpaper
lbbag                   poundbagpaper
poundnewsprintpaper     poundtagpaper
lbnewsprint             poundnewsprintpaper
poundposterpaper        poundtagpaper
lbposter                poundposterpaper
poundtissuepaper        poundtagpaper
lbtissue                poundtissuepaper
poundwrappingpaper      poundtagpaper
lbwrapping              poundwrappingpaper
poundwaxingpaper        poundtagpaper
lbwaxing                poundwaxingpaper
poundglassinepaper      poundtagpaper
lbglassine              poundglassinepaper
poundcoverpaper         lb / 20 inch 26 inch ream
lbcover                 poundcoverpaper
poundindexpaper         lb / 25.5 inch 30.5 inch ream
lbindex                 poundindexpaper
poundindexbristolpaper  poundindexpaper
lbindexbristol          poundindexpaper
poundbondpaper          lb / 17 inch 22 inch ream  # Bond paper is stiff and
lbbond                  poundbondpaper             # durable for repeated
poundwritingpaper       poundbondpaper             # filing, and it resists
lbwriting               poundwritingpaper          # ink penetration.
poundledgerpaper        poundbondpaper
lbledger                poundledgerpaper
poundcopypaper          poundbondpaper
lbcopy                  poundcopypaper
poundblottingpaper      lb / 19 inch 24 inch ream
lbblotting              poundblottingpaper
poundblankspaper        lb / 22 inch 28 inch ream
lbblanks                poundblankspaper
poundpostcardpaper      lb / 22.5 inch 28.5 inch ream
lbpostcard              poundpostcardpaper
poundweddingbristol     poundpostcardpaper
lbweddingbristol        poundweddingbristol
poundbristolpaper       poundweddingbristol
lbbristol               poundbristolpaper
poundboxboard           lb / 1000 ft^2
lbboxboard              poundboxboard
poundpaperboard         poundboxboard
lbpaperboard            poundpaperboard

# When paper is marked in units of M, it means the weight of 1000 sheets of the
# given size of paper.  To convert this to paper weight, divide by the size of
# the paper in question.

paperM                  lb / 1000

# In addition paper weight is reported in "caliper" which is simply the
# thickness of one sheet, typically in inches.  Thickness is also reported in
# "points" where a point is 1|1000 inch.  These conversions are supplied to
# convert these units roughly (using an approximate density) into the standard
# paper weight values.

pointthickness          0.001 in
paperdensity            0.8 g/cm^3        # approximate--paper densities vary!
papercaliper            in paperdensity
paperpoint              pointthickness paperdensity

!endcategory

#
# Printing
#

!category printing "Printing Units"

fournierpoint           0.1648 inch / 12  # First definition of the printers
                                          # point made by Pierre Fournier who
                                          # defined it in 1737 as 1|12 of a
                                          # cicero which was 0.1648 inches.
olddidotpoint           1|72 frenchinch   # François Ambroise Didot, one of
                                          # a family of printers, changed
                                          # Fournier's definition around 1770
                                          # to fit to the French units then in
                                          # use.
bertholdpoint           1|2660 m          # H. Berthold tried to create a
                                          # metric version of the didot point
                                          # in 1878.
INpoint                 0.4 mm            # This point was created by a
                                          # group directed by Fermin Didot in
                                          # 1881 and is associated with the
                                          # imprimerie nationale.  It doesn't
                                          # seem to have been used much.
germandidotpoint        0.376065 mm       # Exact definition appears in DIN
                                          # 16507, a German standards document
                                          # of 1954.  Adopted more broadly  in
                                          # 1966 by ???
metricpoint             3|8 mm            # Proposed in 1977 by Eurograf
oldpoint                1|72.27 inch      # The American point was invented
printerspoint           oldpoint          # by Nelson Hawks in 1879 and
texpoint                oldpoint          # dominates USA publishing.
                                          # It was standardized by the American
                                          # Typefounders Association at the
                                          # value of 0.013837 inches exactly.
                                          # Knuth uses the approximation given
                                          # here (which is very close).  The
                                          # comp.fonts FAQ claims that this
                                          # value is supposed to be 1|12 of a
                                          # pica where 83 picas is equal to 35
                                          # cm.  But this value differs from
                                          # the standard.
texscaledpoint          1|65536 texpoint  # The TeX typesetting system uses
texsp                   texscaledpoint    # this for all computations.
computerpoint           1|72 inch         # The American point was rounded
point                   computerpoint
computerpica            12 computerpoint  # to an even 1|72 inch by computer
postscriptpoint         computerpoint     # people at some point.
pspoint                 postscriptpoint
twip                    1|20 point        # TWentieth of an Imperial Point
Q                       1|4 mm            # Used in Japanese phototypesetting
                                          # Q is for quarter
frenchprinterspoint     olddidotpoint
didotpoint              germandidotpoint  # This seems to be the dominant value
europeanpoint           didotpoint        # for the point used in Europe
cicero                  12 didotpoint

stick                   2 inches

# Type sizes

excelsior               3 oldpoint
brilliant               3.5 oldpoint
diamondtype             4 oldpoint
pearl                   5 oldpoint
agate                   5.5 oldpoint  # Originally agate type was 14 lines per
                                      #   inch, giving a value of 1|14 in.
ruby                    agate         # British
nonpareil               6 oldpoint
mignonette              6.5 oldpoint
emerald                 mignonette    # British
minion                  7 oldpoint
brevier                 8 oldpoint
bourgeois               9 oldpoint
longprimer              10 oldpoint
smallpica               11 oldpoint
pica                    12 oldpoint
english                 14 oldpoint
columbian               16 oldpoint
greatprimer             18 oldpoint
paragon                 20 oldpoint
meridian                44 oldpoint
canon                   48 oldpoint

# German type sizes

nonplusultra            2 didotpoint
brillant                3 didotpoint
diamant                 4 didotpoint
perl                    5 didotpoint
nonpareille             6 didotpoint
kolonel                 7 didotpoint
petit                   8 didotpoint
borgis                  9 didotpoint
korpus                  10 didotpoint
corpus                  korpus
garamond                korpus
mittel                  14 didotpoint
tertia                  16 didotpoint
text                    18 didotpoint
kleine_kanon            32 didotpoint
kanon                   36 didotpoint
grobe_kanon             42 didotpoint
missal                  48 didotpoint
kleine_sabon            72 didotpoint
grobe_sabon             84 didotpoint

!endcategory

#
# Information theory units.  Note that the name "entropy" is used both
# to measure information and as a physical quantity.
#

!category compuing "Computing Units"

information             ? bit

#nat                     (1/ln(2)) bits       # Entropy measured base e
#hartley                 log2(10) bits        # Entropy of a uniformly
#ban                     hartley              #   distributed random variable
                                             #   over 10 symbols.
#dit                     hartley              # from Decimal digIT

#
# Computer
#

b                       bit
bps                     bit/sec              # Sometimes the term "baud" is
                                             #   incorrectly used to refer to
                                             #   bits per second.  Baud refers
                                             #   to symbols per second.  Modern
                                             #   modems transmit several bits
                                             #   per symbol.
Kbps                    kbps                 # Irregular prefixes
mbps                    Mbps
gbps                    Gbps
byte                    8 bit                # Not all machines had 8 bit
B                       byte                 #   bytes, but these days most of
                                             #   them do.  But beware: for
                                             #   transmission over modems, a
                                             #   few extra bits are used so
                                             #   there are actually 10 bits per
                                             #   byte.
KB                      kB                   # Irregular prefix
octet                   8 bits               # The octet is always 8 bits
nybble                  4 bits               # Half of a byte. Sometimes
                                             #   equal to different lengths
                                             #   such as 3 bits.
nibble                  nybble
nyp                     2 bits               # Donald Knuth asks in an exercise
                                             #   for a name for a 2 bit
                                             #   quantity and gives the "nyp"
                                             #   as a solution due to Gregor
                                             #   Purdy.  Not in common use.
meg                     megabyte             # Some people consider these
                                             # units along with the kilobyte
gig                     gigabyte             # to be defined according to
                                             # powers of 2 with the kilobyte
                                             # equal to 2^10 bytes, the
                                             # megabyte equal to 2^20 bytes and
                                             # the gigabyte equal to 2^30 bytes
                                             # but these usages are forbidden
                                             # by SI.  Binary prefixes have
                                             # been defined by IEC to replace
                                             # the SI prefixes.  Use them to
                                             # get the binary values: KiB, MiB,
                                             # and GiB.
jiffy                   0.01 sec     # This is defined in the Jargon File
jiffies                 jiffy        # (http://www.jargon.org) as being the
                                     # duration of a clock tick for measuring
                                     # wall-clock time.  Supposedly the value
                                     # used to be 1|60 sec or 1|50 sec
                                     # depending on the frequency of AC power,
                                     # but then 1|100 sec became more common.
                                     # On linux systems, this term is used and
                                     # for the Intel based chips, it does have
                                     # the value of .01 sec.  The Jargon File
                                     # also lists two other definitions:
                                     # millisecond, and the time taken for
                                     # light to travel one foot.
cdaudiospeed      44.1 kHz 2*16 bits # CD audio data rate at 44.1 kHz with 2
                                     # samples of sixteen bits each.
cdromspeed       75 2048 bytes / sec # For data CDs (mode1) 75 sectors are read
                                     # each second with 2048 bytes per sector.
                                     # Audio CDs do not have sectors, but
                                     # people sometimes divide the bit rate by
                                     # 75 and claim a sector length of 2352.
                                     # Data CDs have a lower rate due to
                                     # increased error correction overhead.
                                     # There is a rarely used mode (mode2) with
                                     # 2336 bytes per sector that has fewer
                                     # error correction bits than mode1.
dvdspeed                 1385 kB/s   # This is the "1x" speed of a DVD using
                                     # constant linear velocity (CLV) mode.
                                     # Modern DVDs may vary the linear velocity
                                     # as they go from the inside to the
                                     # outside of the disc.
                       # See http://www.osta.org/technology/dvdqa/dvdqa4.htm

!endcategory

#
# Musical measures.  Musical intervals expressed as ratios.  Multiply
# two intervals together to get the sum of the interval.  The function
# musicalcent can be used to convert ratios to cents.
#

!category music "Musical Measures"

# Perfect intervals

octave                  2
majorsecond             musicalfifth^2 / octave
majorthird              5|4
minorthird              6|5
musicalfourth           4|3
musicalfifth            3|2
majorsixth              musicalfourth majorthird
minorsixth              musicalfourth minorthird
majorseventh            musicalfifth majorthird
minorseventh            musicalfifth minorthird

pythagoreanthird        majorsecond musicalfifth^2 / octave
syntoniccomma           pythagoreanthird / majorthird
pythagoreancomma        musicalfifth^12 / octave^7

# Equal tempered definitions

semitone                octave^(1|12)
#musicalcent(x) units=[1;1] range=(0,) semitone^(x/100) ; \
#                                      100 log(musicalcent)/log(semitone)

#
# Musical note lengths.
#

wholenote               !
musical_note_length     ? wholenote
halfnote                1|2 wholenote
quarternote             1|4 wholenote
eighthnote              1|8 wholenote
sixteenthnote           1|16 wholenote
thirtysecondnote        1|32 wholenote
sixtyfourthnote         1|64 wholenote
dotted                  3|2
doubledotted            7|4
breve                   doublewholenote
semibreve               wholenote
minimnote               halfnote
crotchet                quarternote
quaver                  eighthnote
semiquaver              sixteenthnote
demisemiquaver          thirtysecondnote
hemidemisemiquaver      sixtyfourthnote
semidemisemiquaver      hemidemisemiquaver

!endcategory

#
# yarn and cloth measures
#

!category cloth "Yarn and Cloth Measures"

# yarn linear density

woolyarnrun             1600 yard/pound # 1600 yds of "number 1 yarn" weighs
                                        # a pound.
yarncut                 300 yard/pound  # Less common system used in
                                        # Pennsylvania for wool yarn
cottonyarncount         840 yard/pound
linenyarncount          300 yard/pound  # Also used for hemp and ramie
worstedyarncount        1680 ft/pound
metricyarncount         meter/gram
denier                  1|9 tex            # used for silk and rayon
manchesteryarnnumber    drams/1000 yards   # old system used for silk
pli                     lb/in
typp                    1000 yd/lb   # abbreviation for Thousand Yard Per Pound
asbestoscut             100 yd/lb    # used for glass and asbestos yarn

tex                     gram / km    # rational metric yarn measure, meant
drex                    0.1 tex      # to be used for any kind of yarn
poumar                  lb / 1e6 yard

# yarn and cloth length

skeincotton             80*54 inch   # 80 turns of thread on a reel with a
                                     #  54 in circumference (varies for other
                                     #  kinds of thread)
cottonbolt              120 ft       # cloth measurement
woolbolt                210 ft
bolt                    cottonbolt
heer                    600 yards
cut                     300 yards    # used for wet-spun linen yarn
lea                     300 yards

sailmakersyard          28.5 in
sailmakersounce         oz / sailmakersyard 36 inch

silkmomme               momme / 25 yards 1.49 inch  # Traditional silk weight
silkmm                  silkmomme        # But it is also defined as
                                         # lb/100 yd 45 inch.  The two
                                         # definitions are slightly different
                                         # and neither one seems likely to be
                                         # the true source definition.

!endcategory

#
# drug dosage
#

!category dosage "Drug Dosage"

mcg                     microgram        # Frequently used for vitamins
iudiptheria             62.8 microgram   # IU is for international unit
iupenicillin            0.6 microgram
iuinsulin               41.67 microgram
drop                    1|20 ml          # The drop was an old "unit" that was
                                         # replaced by the minim.  But I was
                                         # told by a pharmacist that in his
                                         # profession, the conversion of 20
                                         # drops per ml is actually used.
bloodunit               450 ml           # For whole blood.  For blood
                                         # components, a blood unit is the
                                         # quanity of the component found in a
                                         # blood unit of whole blood.  The
                                         # human body contains about 12 blood
                                         # units of whole blood.

#
# misc medical measure
#

frenchcathetersize      1|3 mm           # measure used for the outer diameter
                                         # of a catheter
charriere               frenchcathetersize

!endcategory

#
# fixup units for times when prefix handling doesn't do the job
#

hectare                 hectoare
megohm                  megaohm
kilohm                  kiloohm
microhm                 microohm
megalerg                megaerg    # 'L' added to make it pronounceable [18].

#
# Units used for measuring volume of wood
#

!category wood "Wood Measures"

cord                    4*4*8 ft^3   # 4 ft by 4 ft by 8 ft bundle of wood
facecord                1|2 cord
cordfoot                1|8 cord     # One foot long section of a cord
cordfeet                cordfoot
housecord               1|3 cord     # Used to sell firewood for residences,
                                     #   often confusingly called a "cord"
boardfoot               ft^2 inch    # Usually 1 inch thick wood
boardfeet               boardfoot
fbm                     boardfoot    # feet board measure
stack                   4 yard^3     # British, used for firewood and coal [18]
rick                    4 ft 8 ft 16 inches # Stack of firewood, supposedly
                                     #   sometimes called a face cord, but this
                                     #   value is equal to 1|3 cord.  Name
                                     #   comes from an old Norse word for a
                                     #   stack of wood.
stere                   m^3
timberfoot              ft^3         # Used for measuring solid blocks of wood
standard                120 12 ft 11 in 1.5 in  # This is the St Petersburg or
                                     #   Pittsburg standard.  Apparently the
                                     #   term is short for "standard hundred"
                                     #   which was meant to refer to 100 pieces
                                     #   of wood (deals).  However, this
                                     #   particular standard is equal to 120
                                     #   deals which are 12 ft by 11 in by 1.5
                                     #   inches (not the standard deal).
hoppusfoot               (4/pi) ft^3 # Volume calculation suggested in 1736
hoppusboardfoot      1|12 hoppusfoot #   forestry manual by Edward Hoppus, for
hoppuston              50 hoppusfoot #   estimating the usable volume of a log.
                                     #   It results from computing the volume
                                     #   of a cylindrical log of length, L, and
                                     #   girth (circumference), G, by V=L(G/4)^2.
                                     #   The hoppus ton is apparently still in
                                     #   use for shipments from Southeast Asia.

# In Britain, the deal is apparently any piece of wood over 6 feet long, over
# 7 wide and 2.5 inches thick.  The OED doesn't give a standard size.  A piece
# of wood less than 7 inches wide is called a "batten".  This unit is now used
# exclusively for fir and pine.

deal              12 ft 11 in 2.5 in # The standard North American deal [OED]
wholedeal        12 ft 11 in 1.25 in # If it's half as thick as the standard
                                     #   deal it's called a "whole deal"!
splitdeal         12 ft 11 in 5|8 in # And half again as thick is a split deal.

# Used for shellac mixing rate

poundcut            pound / gallon
lbcut               poundcut

!endcategory

#
# Gas and Liquid flow units
#

!category flow_units "Fluid Flow Units"

#FLUID_FLOW              VOLUME / TIME

# Some obvious volumetric gas flow units (cu is short for cubic)

cumec                   m^3/s
cusec                   ft^3/s

# Conventional abbreviations for fluid flow units

gph                     gal/hr
gpm                     gal/min
mgd                     megagal/day
cfs                     ft^3/s
cfh                     ft^3/hour
cfm                     ft^3/min
lpm                     liter/min
lfm                     ft/min     # Used to report air flow produced by fans.
                                   # Multiply by cross sectional area to get a
                                   # flow in cfm.

pru                     mmHg / (ml/min)  # peripheral resistance unit, used in
                                         # medicine to assess blood flow in
                                         # the capillaries.

# Miner's inch:  This is an old historic unit used in the Western  United
# States.  It is generally defined as the rate of flow through a one square
# inch hole at a specified depth such as 4 inches.  In the late 19th century,
# volume of water was sometimes measured in the "24 hour inch".  Values for the
# miner's inch were fixed by state statues.  (This information is from a web
# site operated by the Nevada Division of Water Planning:  The Water Words
# Dictionary at http://www.state.nv.us/cnr/ndwp/dict-1/waterwds.htm.)

minersinchAZ            1.5 ft^3/min
minersinchCA            1.5 ft^3/min
minersinchMT            1.5 ft^3/min
minersinchNV            1.5 ft^3/min
minersinchOR            1.5 ft^3/min
minersinchID            1.2 ft^3/min
minersinchKS            1.2 ft^3/min
minersinchNE            1.2 ft^3/min
minersinchNM            1.2 ft^3/min
minersinchND            1.2 ft^3/min
minersinchSD            1.2 ft^3/min
minersinchUT            1.2 ft^3/min
minersinchCO            1 ft^3/sec / 38.4  # 38.4 miner's inches = 1 ft^3/sec
minersinchBC            1.68 ft^3/min      # British Columbia

# Oceanographic flow

sverdrup                1e6 m^3 / sec   # Used to express flow of ocean
                                        # currents.  Named after Norwegian
                                        # oceanographer H. Sverdrup.

# In vacuum science and some other applications, gas flow is measured
# as the product of volumetric flow and pressure.  This is useful
# because it makes it easy to compare with the flow at standard
# pressure (one atmosphere).  It also directly relates to the number
# of gas molecules per unit time, and hence to the mass flow if the
# molecular mass is known.

#GAS_FLOW                PRESSURE FLUID_FLOW

sccm                    atm cc/min     # 's' is for "standard" to indicate
sccs                    atm cc/sec     # flow at standard pressure
scfh                    atm ft^3/hour  #
scfm                    atm ft^3/min
slpm                    atm liter/min
slph                    atm liter/hour
lusec                   liter micron Hg / s  # Used in vacuum science

!endcategory

# US Standard Atmosphere (1976)
# Atmospheric temperature and pressure vs. geometric height above sea level
# This definition covers only the troposphere (the lowest atmospheric
# layer, up to 11 km), and assumes the layer is polytropic.
# A polytropic process is one for which PV^k = const, where P is the
# pressure, V is the volume, and k is the polytropic exponent.  The
# polytropic index is n = 1 / (k - 1).  As noted in the Wikipedia article
# https://en.wikipedia.org/wiki/Polytropic_process, some authors reverse
# the definitions of "exponent" and "index."  The functions below assume
# the following parameters:

!category atmospheric "Atmospheric Measures"

# temperature lapse rate, -dT/dz, in troposphere

lapserate	6.5 K/km	# US Std Atm (1976)

# air molecular weight, including constituent mol wt, given
# in Table 3, p. 3

air_1976      78.084   %  28.0134  g/mol \
          +   20.9476  %  31.9988  g/mol \
          + 9340     ppm  39.948   g/mol \
          +  314     ppm  44.00995 g/mol \
          +   18.18  ppm  20.183   g/mol \
          +    5.24  ppm   4.0026  g/mol \
          +    2     ppm  16.04303 g/mol \
          +    1.14  ppm  83.80    g/mol \
          +    0.55  ppm   2.01594 g/mol \
          +    0.087 ppm 131.30    g/mol

# universal gas constant
R_1976		8.31432e3 N m/(kmol K)

# polytropic index n
polyndx_1976	air_1976 gravity/(R_1976 lapserate) - 1

# If desired, redefine using current values for air mol wt and R

polyndx		polyndx_1976
# polyndx	air (kg/kmol) gravity/(R lapserate) - 1

# for comparison with various references

polyexpnt	(polyndx + 1) / polyndx

# The model assumes the following reference values:
# sea-level temperature and pressure

stdatmT0	288.15 K
stdatmP0	atm

# "effective radius" for relation of geometric to geopotential height,
# at a latitude at which g = 9.80665 m/s (approximately 45.543 deg); no
# relation to actual radius

earthradUSAtm	6356766 m

# Temperature vs. geopotential height h
# Assumes 15 degC at sea level
# Based on approx 45 deg latitude
# Lower limits of domain and upper limits of range are those of the
# tables in US Standard Atmosphere (NASA 1976)

#stdatmTH(h) units=[m;K] domain=[-5000,11e3] range=[217,321] \
#    stdatmT0+(-lapserate h) ; (stdatmT0+(-stdatmTH))/lapserate

# Temperature vs. geometric height z; based on approx 45 deg latitude
#stdatmT(z) units=[m;K] domain=[-5000,11e3] range=[217,321] \
#    stdatmTH(geop_ht(z)) ; ~geop_ht(~stdatmTH(stdatmT))

# Pressure vs. geopotential height h
# Assumes 15 degC and 101325 Pa at sea level
# Based on approx 45 deg latitude
# Lower limits of domain and upper limits of range are those of the
# tables in US Standard Atmosphere (NASA 1976)

#stdatmPH(h) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \
#    atm (1 - (lapserate/stdatmT0) h)^(polyndx + 1) ; \
#    (stdatmT0/lapserate) (1+(-(stdatmPH/stdatmP0)^(1/(polyndx + 1))))

# Pressure vs. geometric height z; based on approx 45 deg latitude
#stdatmP(z) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \
#   stdatmPH(geop_ht(z)); ~geop_ht(~stdatmPH(stdatmP))

# Geopotential height from geometric height
# Based on approx 45 deg latitude
# Lower limits of domain and range are somewhat arbitrary; they
# correspond to the limits in the US Std Atm tables

#geop_ht(z) units=[m;m] domain=[-5000,) range=[-5004,) \
#    (earthradUSAtm z) / (earthradUSAtm + z) ; \
#    (earthradUSAtm geop_ht) / (earthradUSAtm + (-geop_ht))

# The standard value for the sea-level acceleration due to gravity is
# 9.80665 m/s^2, but the actual value varies with latitude (Harrison 1949)
# R_eff = 2 g_phi / denom
# g_phi = 978.0356e-2 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2)
#   or
# g_phi = 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2)
# denom = 3.085462e-6+2.27e-9 cos(2 lat)+(-2e-12) cos(4 lat) (minutes?)
# There is no inverse function; the standard value applies at a latitude
# of about 45.543 deg

#g_phi(lat) units=[deg;m/s2] domain=[0,90] noerror  \
#    980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) m/s2

# effective Earth radius for relation of geometric height to
# geopotential height, as function of latitude (Harrison 1949)

#earthradius_eff(lat) units=[deg;m] domain=[0,90] noerror \
#    m 2 9.780356 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) / \
#    (3.085462e-6 + 2.27e-9 cos(2 lat) + (-2e-12) cos(4 lat))

# References
# Harrison, L.P. 1949.  Relation Between Geopotential and Geometric
#   Height.  In Smithsonian Meteorological Tables. List, Robert J., ed.
#   6th ed., 4th reprint, 1968.  Washington, DC: Smithsonian Institution.
# NASA.  US National Aeronautics and Space Administration. 1976.
#   US Standard Atmosphere 1976.  Washington, DC: US Government Printing Office.

# Gauge pressure functions
#
# Gauge pressure is measured relative to atmospheric pressure.  In the English
# system, where pressure is often given in pounds per square inch, gauge
# pressure is often indicated by 'psig' to distinguish it from absolute
# pressure, often indicated by 'psia'.  At the standard atmospheric pressure
# of 14.696 psia, a gauge pressure of 0 psig is an absolute pressure of 14.696
# psia; an automobile tire inflated to 31 psig has an absolute pressure of
# 45.696 psia.
#
# With gaugepressure(), the units must be specified (e.g., gaugepressure(1.5
# bar)); with psig(), the units are taken as psi, so the example above of tire
# pressure could be given as psig(31).
#
# If the normal elevation is significantly different from sea level, change
# Patm appropriately, and adjust the lower domain limit on the gaugepressure
# definition.

#Patm	atm

#gaugepressure(x) units=[Pa;Pa] domain=[-101325,) range=[0,) \
#                x + Patm ; gaugepressure+(-Patm)

#psig(x) units=[1;Pa] domain=[-14.6959487755135,) range=[0,) \
#    gaugepressure(x psi) ; ~gaugepressure(psig) / psi

!endcategory

#
# Wire Gauge
#
# This area is a nightmare with huge charts of wire gauge diameters
# that usually have no clear origin.  There are at least 5 competing wire gauge
# systems to add to the confusion.  The use of wire gauge is related to the
# manufacturing method: a metal rod is heated and drawn through a hole.  The
# size change can't be too big.  To get smaller wires, the process is repeated
# with a series of smaller holes.  Generally larger gauges mean smaller wires.
# The gauges often have values such as "00" and "000" which are larger sizes
# than simply "0" gauge.  In the tables that appear below, these gauges must be
# specified as negative numbers (e.g. "00" is -1, "000" is -2, etc).
# Alternatively, you can use the following units:
#

!category gauges "Wire Gauges"

g00                      (-1)
g000                     (-2)
g0000                    (-3)
g00000                   (-4)
g000000                  (-5)
g0000000                 (-6)

!endcategory

# American Wire Gauge (AWG) or Brown & Sharpe Gauge appears to be the most
# important gauge. ASTM B-258 specifies that this gauge is based on geometric
# interpolation between gauge 0000, which is 0.46 inches exactly, and gauge 36
# which is 0.005 inches exactly.  Therefore, the diameter in inches of a wire
# is given by the formula 1|200 92^((36-g)/39).  Note that 92^(1/39) is close
# to 2^(1/6), so diameter is approximately halved for every 6 gauges.  For the
# repeated zero values, use negative numbers in the formula.  The same document
# also specifies rounding rules which seem to be ignored by makers of tables.
# Gauges up to 44 are to be specified with up to 4 significant figures, but no
# closer than 0.0001 inch.  Gauges from 44 to 56 are to be rounded to the
# nearest 0.00001 inch.
#
# In addition to being used to measure wire thickness, this gauge is used to
# measure the thickness of sheets of aluminum, copper, and most metals other
# than steel, iron and zinc.

#wiregauge(g) units=[1;m] range=(0,) \
#             1|200 92^((36+(-g))/39) in; 36+(-39)ln(200 wiregauge/in)/ln(92)
#awg()        wiregauge

# Next we have the SWG, the Imperial or British Standard Wire Gauge.  This one
# is piecewise linear.  It was used for aluminum sheets.

#brwiregauge[in]  \
#       -6 0.5    \
#       -5 0.464  \
#       -3 0.4    \
#       -2 0.372  \
#        3 0.252  \
#        6 0.192  \
#       10 0.128  \
#       14 0.08   \
#       19 0.04   \
#       23 0.024  \
#       26 0.018  \
#       28 0.0148 \
#       30 0.0124 \
#       39 0.0052 \
#       49 0.0012 \
#       50 0.001

# The following is from the Appendix to ASTM B 258
#
#    For example, in U.S. gage, the standard for sheet metal is based on the
#    weight of the metal, not on the thickness. 16-gage is listed as
#    approximately .0625 inch thick and 40 ounces per square foot (the original
#    standard was based on wrought iron at .2778 pounds per cubic inch; steel
#    has almost entirely superseded wrought iron for sheet use, at .2833 pounds
#    per cubic inch). Smaller numbers refer to greater thickness. There is no
#    formula for converting gage to thickness or weight.
#
# It's rather unclear from the passage above whether the plate gauge values are
# therefore wrong if steel is being used.  Reference [15] states that steel is
# in fact measured using this gauge (under the name Manufacturers' Standard
# Gauge) with a density of 501.84 lb/ft3 = 0.2904 lb/in3 used for steel.
# But this doesn't seem to be the correct density of steel (.2833 lb/in3 is
# closer).
#
# This gauge was established in 1893 for purposes of taxation.

# Old plate gauge for iron

#plategauge[(oz/ft^2)/(480*lb/ft^3)] \
#      -5 300   \
#       1 180   \
#      14  50   \
#      16  40   \
#      17  36   \
#      20  24   \
#      26  12   \
#      31   7   \
#      36   4.5 \
#      38   4

# Manufacturers Standard Gage

#stdgauge[(oz/ft^2)/(501.84*lb/ft^3)] \
#      -5 300   \
#       1 180   \
#      14  50   \
#      16  40   \
#      17  36   \
#      20  24   \
#      26  12   \
#      31   7   \
#      36   4.5 \
#      38   4

# A special gauge is used for zinc sheet metal.  Notice that larger gauges
# indicate thicker sheets.

#zincgauge[in]    \
#        1 0.002  \
#       10 0.02   \
#       15 0.04   \
#       19 0.06   \
#       23 0.1    \
#       24 0.125  \
#       27 0.5    \
#       28 1

#
# Screw sizes
#
# In the USA, screw diameters are reported using a gauge number.
# Metric screws are reported as Mxx where xx is the diameter in mm.
#

#screwgauge(g) units=[1;m] range=[0,) \
#              (.06 + .013 g) in ; (screwgauge/in + (-.06)) / .013

#
# Abrasive grit size
#
# Standards governing abrasive grit sizes are complicated, specifying
# fractions of particles that are passed or retained by different mesh
# sizes.  As a result, it is not possible to make precise comparisons
# of different grit standards.  The tables below allow the
# determination of rough equivlants by using median particle size.
#
# Standards in the USA are determined by the Unified Abrasives
# Manufacturers' Association (UAMA), which resulted from the merger of
# several previous organizations.  One of the old organizations was
# CAMI (Coated Abrasives Manufacturers' Institute).
#
# UAMA has a web page with plots showing abrasive particle ranges for
# various different grits and comparisons between standards.
#
# http://www.uama.org/Abrasives101/101Standards.html
#
# Abrasives are grouped into "bonded" abrasives for use with grinding
# wheels and "coated" abrasives for sandpapers and abrasive films.
# The industry uses different grit standards for these two
# categories.
#
# Another division is between "macrogrits", grits below 240 and
# "microgrits", which are above 240.  Standards differ, as do methods
# for determining particle size.  In the USA, ANSI B74.12 is the
# standard governing macrogrits.  ANSI B74.10 covers bonded microgrit
# abrasives, and ANSI B74.18 covers coated microgrit abrasives.  It
# appears that the coated standard is identical to the bonded standard
# for grits up through 600 but then diverges significantly.
#
# European grit sizes are determined by the Federation of European
# Producers of Abrasives.  http://www.fepa-abrasives.org
#
# They give two standards, the "F" grit for bonded abrasives and the
# "P" grit for coated abrasives.  This data is taken directly from
# their web page.

# FEPA P grit for coated abrasives is commonly seen on sandpaper in
# the USA where the paper will be marked P600, for example.  FEPA P
# grits are said to be more tightly constrained than comparable ANSI
# grits so that the particles are more uniform in size and hence give
# a better finish.

#grit_P[micron] \
#        12 1815 \
#        16 1324 \
#        20 1000 \
#        24 764 \
#        30 642 \
#        36 538 \
#        40 425 \
#        50 336 \
#        60 269 \
#        80 201 \
#        100 162 \
#        120 125 \
#        150 100 \
#        180 82 \
#        220 68 \
#        240 58.5 \
#        280 52.2 \
#        320 46.2 \
#        360 40.5 \
#        400 35 \
#        500 30.2 \
#        600 25.8 \
#        800 21.8 \
#        1000 18.3 \
#        1200 15.3 \
#        1500 12.6 \
#        2000 10.3 \
#        2500 8.4

# The F grit is the European standard for bonded abrasives such as
# grinding wheels

#grit_F[micron] \
#        4 4890 \
#        5 4125 \
#        6 3460 \
#        7 2900 \
#        8 2460 \
#        10 2085 \
#        12 1765 \
#        14 1470 \
#        16 1230 \
#        20 1040 \
#        22 885 \
#        24 745 \
#        30 625 \
#        36 525 \
#        40 438 \
#        46 370 \
#        54 310 \
#        60 260 \
#        70 218 \
#        80 185 \
#        90 154 \
#        100 129 \
#        120 109 \
#        150 82 \
#        180 69 \
#        220 58 \
#        230 53 \
#        240 44.5 \
#        280 36.5 \
#        320 29.2 \
#        360 22.8 \
#        400 17.3 \
#        500 12.8 \
#        600 9.3 \
#        800 6.5 \
#        1000 4.5 \
#        1200 3 \
#        1500 2.0 \
#        2000 1.2

# According to the UAMA web page, the ANSI bonded and ANSI coated standards
# are identical to FEPA F in the macrogrit range (under 240 grit), so these
# values are taken from the FEPA F table.  The values for 240 and above are
# from the UAMA web site and represent the average of the "d50" range
# endpoints listed there.

# ansibonded[micron] \
#     4 4890 \
#     5 4125 \
#     6 3460 \
#     7 2900 \
#     8 2460 \
#     10 2085 \
#     12 1765 \
#     14 1470 \
#     16 1230 \
#     20 1040 \
#     22 885 \
#     24 745 \
#     30 625 \
#     36 525 \
#     40 438 \
#     46 370 \
#     54 310 \
#     60 260 \
#     70 218 \
#     80 185 \
#     90 154 \
#     100 129 \
#     120 109 \
#     150 82 \
#     180 69 \
#     220 58 \
#     240 50 \
#     280 39.5 \
#     320 29.5 \
#     360 23 \
#     400 18.25 \
#     500 13.9 \
#     600 10.55 \
#     800 7.65 \
#     1000 5.8 \
#     1200 3.8

# grit_ansibonded() ansibonded

# Like the bonded grit, the coated macrogrits below 240 are taken from the
# FEPA F table.  Data above this is from the UAMA site.  Note that the coated
# and bonded standards are evidently the same from 240 up to 600 grit, but
# starting at 800 grit, the coated standard diverges.  The data from UAMA show
# that 800 grit coated has an average size slightly larger than the average
# size of 600 grit coated/bonded.  However, the 800 grit has a significantly
# smaller particle size variation.
#
# Because of this non-monotonicity from 600 grit to 800 grit this definition
# produces a warning about the lack of a unique inverse.

# ansicoated[micron] noerror \
#     4 4890 \
#     5 4125 \
#     6 3460 \
#     7 2900 \
#     8 2460 \
#     10 2085 \
#     12 1765 \
#     14 1470 \
#     16 1230 \
#     20 1040 \
#     22 885 \
#     24 745 \
#     30 625 \
#     36 525 \
#     40 438 \
#     46 370 \
#     54 310 \
#     60 260 \
#     70 218 \
#     80 185 \
#     90 154 \
#     100 129 \
#     120 109 \
#     150 82 \
#     180 69 \
#     220 58 \
#     240 50 \
#     280 39.5 \
#     320 29.5 \
#     360 23 \
#     400 18.25 \
#     500 13.9 \
#     600 10.55 \
#     800 11.5 \
#     1000 9.5 \
#     2000 7.2 \
#     2500 5.5 \
#     3000 4 \
#     4000 3 \
#     6000 2 \
#     8000 1.2

# grit_ansicoated()  ansicoated


#
# Is this correct?  This is the JIS Japanese standard used on waterstones
#
# jisgrit[micron] \
#      150 75 \
#      180 63 \
#      220 53 \
#      280 48 \
#      320 40 \
#      360 35 \
#      400 30 \
#      600 20 \
#      700 17 \
#      800 14 \
#      1000 11.5 \
#      1200 9.5 \
#      1500 8 \
#      2000 6.7 \
#      2500 5.5 \
#      3000 4 \
#      4000 3 \
#      6000 2 \
#      8000 1.2

# The "Finishing Scale" marked with an A (e.g. A75).  This information
# is from the web page of the sand paper manufacturer Klingspor
# http://www.klingspor.com/gritgradingsystems.htm
#
# I have no information about what this scale is used for.

# grit_A[micron]\
#      16 15.3 \
#      25 21.8 \
#      30 23.6 \
#      35 25.75 \
#      45 35 \
#      60 46.2 \
#      65 53.5 \
#      75 58.5 \
#      90 65 \
#      110 78 \
#      130 93 \
#      160 127 \
#      200 156
#
# Grits for DMT brand diamond sharpening stones from
# http://dmtsharp.com/products/colorcode.htm
#

!category grits "Grit Sizes"

dmtxxcoarse  120 micron    # 120 mesh
dmtsilver    dmtxxcoarse
dmtxx        dmtxxcoarse
dmtxcoarse   60 micron     # 220 mesh
dmtx         dmtxcoarse
dmtblack     dmtxcoarse
dmtcoarse    45 micron     # 325 mesh
dmtc         dmtcoarse
dmtblue      dmtcoarse
dmtfine      25 micron     # 600 mesh
dmtred       dmtfine
dmtf         dmtfine
dmtefine     9 micron      # 1200 mesh
dmte         dmtefine
dmtgreen     dmtefine
dmtceramic   7 micron      # 2200 mesh
dmtcer       dmtceramic
dmtwhite     dmtceramic
dmteefine    3 micron      # 8000 mesh
dmttan       dmteefine
dmtee        dmteefine

#
# The following values come from a page in the Norton Stones catalog,
# available at their web page, http://www.nortonstones.com.
#

hardtranslucentarkansas  6 micron     # Natural novaculite (silicon quartz)
softarkansas             22 micron    #   stones

extrafineindia           22 micron    # India stones are Norton's manufactured
fineindia                35 micron    #   aluminum oxide product
mediumindia              53.5 micron
coarseindia              97 micron

finecrystolon            45 micron    # Crystolon stones are Norton's
mediumcrystalon          78 micron    #   manufactured silicon carbide product
coarsecrystalon          127 micron

# The following are not from the Norton catalog
hardblackarkansas        6 micron
hardwhitearkansas        11 micron
washita                  35 micron

!endcategory

#
# Ring size. All ring sizes are given as the circumference of the ring.
#

# USA ring sizes.  Several slightly different definitions seem to be in
# circulation.  According to [15], the interior diameter of size n ring in
# inches is 0.32 n + 0.458 for n ranging from 3 to 13.5 by steps of 0.5.  The
# size 2 ring is inconsistently 0.538in and no 2.5 size is listed.
#
# However, other sources list 0.455 + 0.0326 n and 0.4525 + 0.0324 n as the
# diameter and list no special case for size 2.  (Or alternatively they are
# 1.43 + .102 n and 1.4216+.1018 n for measuring circumference in inches.)  One
# reference claimed that the original system was that each size was 1|10 inch
# circumference, but that source doesn't have an explanation for the modern
# system which is somewhat different.

#ringsize(n) units=[1;in] domain=[2,) range=[1.6252,) \
#            (1.4216+.1018 n) in ; (ringsize/in + (-1.4216))/.1018

# Old practice in the UK measured rings using the "Wheatsheaf gauge" with sizes
# specified alphabetically and based on the ring inside diameter in steps of
# 1|64 inch.  This system was replaced in 1987 by British Standard 6820 which
# specifies sizes based on circumference.  Each size is 1.25 mm different from
# the preceding size.  The baseline is size C which is 40 mm circumference.
# The new sizes are close to the old ones.  Sometimes it's necessary to go
# beyond size Z to Z+1, Z+2, etc.

!category ring_sizes "Ring Sizes"

sizeAring               37.50 mm
sizeBring               38.75 mm
sizeCring               40.00 mm
sizeDring               41.25 mm
sizeEring               42.50 mm
sizeFring               43.75 mm
sizeGring               45.00 mm
sizeHring               46.25 mm
sizeIring               47.50 mm
sizeJring               48.75 mm
sizeKring               50.00 mm
sizeLring               51.25 mm
sizeMring               52.50 mm
sizeNring               53.75 mm
sizeOring               55.00 mm
sizePring               56.25 mm
sizeQring               57.50 mm
sizeRring               58.75 mm
sizeSring               60.00 mm
sizeTring               61.25 mm
sizeUring               62.50 mm
sizeVring               63.75 mm
sizeWring               65.00 mm
sizeXring               66.25 mm
sizeYring               67.50 mm
sizeZring               68.75 mm

!endcategory

# Japanese sizes start with size 1 at a 13mm inside diameter and each size is
# 1|3 mm larger in diameter than the previous one.  They are multiplied by pi
# to give circumference.

#jpringsize(n)  units=[1;mm] domain=[1,) range=[0.040840704,) \
#               (38|3 + n/3) pi mm ; 3 jpringsize/ pi mm + (-38)

# The European ring sizes are the length of the circumference in mm minus 40.

#euringsize(n)  units=[1;mm] (n+40) mm ; euringsize/mm + (-40)

#
# Abbreviations
#

mph                     mile/hr
mpg                     mile/gal
kph                     km/hr
kmh                     km/hr
fL                      footlambert
fpm                     ft/min
fps                     ft/s
rpm                     rev/min
rps                     rev/sec
smi                     mile
nmi                     nauticalmile
mbh                     1e3 btu/hour
mcm                     1e3 circularmil
ipy                     inch/year    # used for corrosion rates
ccf                     100 ft^3     # used for selling water [18]
Mcf                     1000 ft^3    # not million cubic feet [18]
kp                      kilopond
kpm                     kp meter
Wh                      W hour
hph                     hp hour
plf                     lb / foot    # pounds per linear foot

#
# Compatibility units with unix version
#

pa                      Pa
ev                      eV
hg                      Hg
oe                      Oe
mh                      mH
rd                      rod
pf                      pF
gr                      grain
nt                      N
hz                      Hz
hd                      hogshead
dry                     drygallon/gallon
nmile                   nauticalmile
beV                     GeV
bev                     beV
coul                    C

#
# Radioactivity units
#

!category radioactivity "Radioactivity Units"

becquerel               /s           # Activity of radioactive source
Bq                      becquerel    #
curie                   3.7e10 Bq    # Defined in 1910 as the radioactivity
Ci                      curie        # emitted by the amount of radon that is
                                     # in equilibrium with 1 gram of radium.
rutherford              1e6 Bq       #

radiation_dose          gray
gray                    J/kg         # Absorbed dose of radiation
Gy                      gray         #
rad                     1e-2 Gy      # From Radiation Absorbed Dose
rep                     8.38 mGy     # Roentgen Equivalent Physical, the amount
                                     #   of radiation which , absorbed in the
                                     #   body, would liberate the same amount
                                     #   of energy as 1 roentgen of X rays
                                     #   would, or 97 ergs.

sievert                 J/kg         # Dose equivalent:  dosage that has the
Sv                      sievert      #   same effect on human tissues as 200
rem                     1e-2 Sv      #   keV X-rays.  Different types of
                                     #   radiation are weighted by the
                                     #   Relative Biological Effectiveness
                                     #   (RBE).
                                     #
                                     #      Radiation type       RBE
                                     #       X-ray, gamma ray     1
                                     #       beta rays, > 1 MeV   1
                                     #       beta rays, < 1 MeV  1.08
                                     #       neutrons, < 1 MeV   4-5
                                     #       neutrons, 1-10 MeV   10
                                     #       protons, 1 MeV      8.5
                                     #       protons, .1 MeV      10
                                     #       alpha, 5 MeV         15
                                     #       alpha, 1 MeV         20
                                     #
                                     #   The energies are the kinetic energy
                                     #   of the particles.  Slower particles
                                     #   interact more, so they are more
                                     #   effective ionizers, and hence have
                                     #   higher RBE values.
                                     #
                                     # rem stands for Roentgen Equivalent
                                     # Mammal

roentgen              2.58e-4 C / kg # Ionizing radiation that produces
                                     #   1 statcoulomb of charge in 1 cc of
                                     #   dry air at stp.
rontgen                 roentgen     # Sometimes it appears spelled this way
sievertunit             8.38 rontgen # Unit of gamma ray dose delivered in one
                                     #   hour at a distance of 1 cm from a
                                     #   point source of 1 mg of radium
                                     #   enclosed in platinum .5 mm thick.

eman                    1e-7 Ci/m^3  # radioactive concentration
mache                   3.7e-7 Ci/m^3

!endcategory

#
# population units
#

people                  1
person                  people
death                   people
capita                  people
percapita               /capita

# TGM dozen based unit system listed on the "dozenal" forum
# http://www.dozenalsociety.org.uk/apps/tgm.htm.  These units are
# proposed as an allegedly more rational alternative to the SI system.

!category dozenal "Dozenal Units"

Tim                     12^-4 hour         # Time
Grafut                  gravity Tim^2      # Length based on gravity
Surf                    Grafut^2           # area
Volm                    Grafut^3           # volume
Vlos                    Grafut/Tim         # speed
Denz                    Maz/Volm           # density
Mag                     Maz gravity        # force
Maz                     Volm kg / oldliter # mass based on water

Tm                      Tim                # Abbreviations
Gf                      Grafut
Sf                      Surf
Vm                      Volm
Vl                      Vlos
Mz                      Maz
Dz                      Denz

# Dozen based unit prefixes

Zena-                   12
Duna-                   12^2
Trina-                  12^3
Quedra-                 12^4
Quena-                  12^5
Hesa-                   12^6
Seva-                   12^7
Aka-                    12^8
Neena-                  12^9
Dexa-                   12^10
Lefa-                   12^11
Zennila-                12^12

Zeni-                   12^-1
Duni-                   12^-2
Trini-                  12^-3
Quedri-                 12^-4
Queni-                  12^-5
Hesi-                   12^-6
Sevi-                   12^-7
Aki-                    12^-8
Neeni-                  12^-9
Dexi-                   12^-10
Lefi-                   12^-11
Zennili-                12^-12

!endcategory

#
# Traditional Japanese units (shakkanhou)
#
# The traditional system of weights and measures is called shakkanhou from the
# shaku and the ken.  Japan accepted SI units in 1891 and legalized conversions
# to the traditional system.  In 1909 the inch-pound system was also legalized,
# so Japan had three legally approved systems.  A change to the metric system
# started in 1921 but there was a lot of resistance.  The Measurement Law of
# October 1999 prohibits sales in anything but SI units.  However, the old
# units still live on in construction and as the basis for paper sizes of books
# and tools used for handicrafts.
#
# Note that units below use the Hepburn romanization system.  Some other
# systems would render "mou", "jou", and "chou" as "mo", "jo" and "cho".
#
#
# http://hiramatu-hifuka.com/onyak/onyindx.html

# Japanese Proportions.  These are still in everyday use.  They also
# get used as units to represent the proportion of the standard unit.

!category japanese "Traditional Japanese Units"

wari_proportion      1|10
wari                 wari_proportion
bu_proportion        1|100    # The character bu can also be read fun or bun
                              # but usually "bu" is used for units.
rin_proportion       1|1000
mou_proportion       1|10000


# Japanese Length Measures
#
# The length system is called kanejaku or
# square and originated in China.  It was
# adopted as Japan's official measure in 701
# by the Taiho Code.  This system is still in
# common use in architecture and clothing.

shaku              1|3.3 m
mou                1|10000 shaku
rin                1|1000 shaku
bu_distance        1|100 shaku
ja_sun             1|10 shaku
jou_distance       10 shaku
jou                jou_distance

kanejakusun        ja_sun      # Alias to emphasize architectural name
kanejaku           shaku
kanejakujou        jou

# http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
taichi             shaku   # http://zh.wikipedia.org/wiki/台尺
taicun             ja_sun  # http://zh.wikipedia.org/wiki/台制
!utf8
台尺               taichi  # via Hanyu Pinyin romanizations
台寸               taicun
!endutf8

# In context of clothing, shaku is different from architecture
# http://www.scinet.co.jp/sci/sanwa/kakizaki-essay54.html

kujirajaku         10|8 shaku
kujirajakusun      1|10 kujirajaku
kujirajakubu       1|100 kujirajaku
kujirajakujou      10 kujirajaku
tan_distance       3 kujirajakujou

ken                6 shaku  # Also sometimes 6.3, 6.5, or 6.6
                            # http://www.homarewood.co.jp/syakusun.htm

# mostly unused
chou_distance      60 ken
chou               chou_distance
ri                 36 chou

# Japanese Area Measures

# Tsubo is still used for land size, though the others are more
# recognized by their homonyms in the other measurements.

gou_area             1|10 tsubo
tsubo                36 shaku^2    # Size of two tatami = ken^2 ??
se                   30 tsubo
tan_area             10 se
chou_area            10 tan_area

# http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
ping                 tsubo     # http://zh.wikipedia.org/wiki/坪
jia                  2934 ping # http://zh.wikipedia.org/wiki/甲_(单位)
#fen                  1|10 jia  # http://zh.wikipedia.org/wiki/分
fen_area             1|10 jia  # Protection against future collisions
!utf8
坪                   ping      # via Hanyu Pinyin romanizations
甲                   jia
#分                   fen
分地                 fen_area  # Protection against future collisions
!endutf8

# Japanese architecture is based on a "standard" size of tatami mat.
# Room sizes today are given in number of tatami, and this number
# determines the spacing between colums and hence sizes of sliding
# doors and paper screens.  However, every region has its own slightly
# different tatami size.  Edoma, used in and around Tokyo and
# Hokkaido, is becoming a nationwide standard.  Kyouma is used around
# Kyoto, Osaka and Kyuushu, and Chuukyouma is used around Nagoya.
# Note that the tatami all have the aspect ratio 2:1 so that the mats
# can tile the room with some of them turned 90 degrees.
#
# http://www.moon2.net/tatami/infotatami/structure.html

edoma                (5.8*2.9) shaku^2
kyouma               (6.3*3.15) shaku^2
chuukyouma           (6*3) shaku^2
jou_area             edoma
tatami               jou_area

# Japanese Volume Measures

# The "shou" is still used for such things as alcohol and seasonings.
# Large quantities of paint are still purchased in terms of "to".

shaku_volume         1|10 gou_volume
gou_volume           1|10 shou
gou                  gou_volume
shou                 (4.9*4.9*2.7) ja_sun^3# The character shou which is
                                           # the same as masu refers to a
                                           # rectangular wooden cup used to
                                           # measure liquids and cereal.
                                           # Sake is sometimes served in a masu
                                           # Note that it happens to be
                                           # EXACTLY 7^4/11^3 liters.
to                   10 shou
koku                 10 to  # No longer used; historically a measure of rice

# Japanese Weight Measures
#
# http://wyoming.hp.infoseek.co.jp/zatugaku/zamoney.html

# Not really used anymore.

rin_weight           1|10 bu_weight
bu_weight            1|10 monme
fun                  1|10 monme
monme                momme
kin                  160 monme
kan                  1000 monme
kwan                 kan         # This was the old pronounciation of the unit.
                                 # The old spelling persisted a few centuries
                                 # longer and was not changed until around
                                 # 1950.

!endcategory

# http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
# says: "Volume measure in Taiwan is largely metric".

!category taiwan "Taiwanese Units"

taijin               kin      # http://zh.wikipedia.org/wiki/台斤
tailiang             10 monme # http://zh.wikipedia.org/wiki/台斤
taiqian              monme    # http://zh.wikipedia.org/wiki/台制
!utf8
台斤                 taijin # via Hanyu Pinyin romanizations
台兩                 tailiang
台錢                 taiqian
!endutf8

!endcategory

#
# Australian unit
#

australiasquare         (10 ft)^2   # Used for house area


#
# A few German units as currently in use.
#

zentner                 50 kg
doppelzentner           2 zentner
pfund                   500 g

#
# Some traditional Russian measures
#

!category russian "Traditional Russian Units"

# length

точка                   1|10 линия
tochka                  точка
линия                   1|10 дюим
liniya                  линия
дюим                    1 inch
dyuim                   дюим
вершок                  1.75 in
vershok                 вершок
пядь                    7 дюим
piad                    пядь
четверть                пядь
chetvert                четверть
фут                     1 foot
fut                     фут
аршин                   7|3 ft
arshin                  аршин
сажень                  7 ft
sazhen                  сажень
верста                  1500 аршин
versta                  верста
миля                    10500 аршин
milia                   миля

# area

казенная_десятина       2400 сажень^2
kazionnaya_desiatina    казенная_десятина
official_desiatina      казенная_десятина
владельческая_десятина  3200 сажень^2
vladelcheskaya_desiatina владельческая_десятина
proprietors_desiatina   владельческая_десятина

# dry measures

часть                   1|12 сухкружка
chast                   часть
сухкружка               2|5 гарнец
drykruzhka              сухкружка
гарнец                  200 in^3
garnets                 гарнец
сухведро                4 гарнец
dryvedro                сухведро
четверик                2 сухведро
chetverik               четверик
осьмина                 4 четверик
osmina                  осьмина
сухчетверть             2 осьмина
drychetvert             четверть

# liquid measures

шкалик                  1|2 чарка
shlalik                 шкалик
косушка                 1|2 чарка
kosushka                косушка
чарка                   1|10 жидккружка
charka                  чарка
жидккружка              1|10 жидкведро
fluidkruzhka            жидккружка
штоф                    1|10 жидкведро
shtof                   штоф
жидкчетверть            1|8 жидкведро
fluidchetvert           жидкчетверть
жидкведро               750 in^3
fuidvedro               жидкведро
бочка                   40 жидкведро
bochka                  бочка

# common mass

доля                    1|96 золотник
dolia                   доля
золотник                1|3 лот
zolotnik                золотник
лот                     1|13 фунт
lot                     лот
фунт                    0.903 lb
funt                    фунт
пуд                     40 фунт
pood                    пуд
берковец                10 пуд
berkovets               берковец

# apothecary mass

гран                    7|5 доля
gran                    гран
скрупул                 20 гран
scrupul                 скрупул
драхма                  3 скрупул
drachma                 драхма
унция                   8 драхма
uncia                   унция
апфунт                  12 унция
apfunt                  фунт

!endcategory


#
# Old French distance measures, from French Weights and Measures
# Before the Revolution by Zupko
#

!category french "French Old Measures"

frenchfoot              144|443.296 m     # pied de roi, the standard of Paris.
pied                    frenchfoot        #   Half of the hashimicubit,
frenchfeet              frenchfoot        #   instituted by Charlemagne.
frenchinch              1|12 frenchfoot   #   This exact definition comes from
frenchthumb             frenchinch        #   a law passed on 10 Dec 1799 which
pouce                   frenchthumb       #   fixed the meter at
                                          #   3 frenchfeet + 11.296 lignes.
frenchline              1|12 frenchinch   # This is supposed to be the size
ligne                   frenchline        #   of the average barleycorn
frenchpoint             1|12 frenchline
toise                   6 frenchfeet
arpent                  180^2 pied^2      # The arpent is 100 square perches,
                                          # but the perche seems to vary a lot
                                          # and can be 18 feet, 20 feet, or 22
                                          # feet.  This measure was described
                                          # as being in common use in Canada in
                                          # 1934 (Websters 2nd).  The value
                                          # given here is the Paris standard
                                          # arpent.
frenchgrain             1|18827.15 kg     # Weight of a wheat grain, hence
                                          # smaller than the British grain.
frenchpound             9216 frenchgrain

!endcategory

#
# Before the Imperial Weights and Measures Act of 1824, various different
# weights and measures were in use in different places.
#

!category scots "Scotland Measures"

# Scots linear measure

scotsinch        1.00540054 UKinch
scotslink        1|100 scotschain
scotsfoot        12 scotsinch
scotsfeet        scotsfoot
scotsell         37 scotsinch
scotsfall        6 scotsell
scotschain       4 scotsfall
scotsfurlong     10 scotschain
scotsmile        8 scotsfurlong

# Scots area measure

scotsrood        40 scotsfall^2
scotsacre        4 scotsrood

!endcategory

# Irish linear measure

!category irish "Ireland Measures"

irishinch       UKinch
irishpalm       3 irishinch
irishspan       3 irishpalm
irishfoot       12 irishinch
irishfeet       irishfoot
irishcubit      18 irishinch
irishyard       3 irishfeet
irishpace       5 irishfeet
irishfathom     6 irishfeet
irishpole       7 irishyard      # Only these values
irishperch      irishpole        # are different from
irishchain      4 irishperch     # the British Imperial
irishlink       1|100 irishchain # or English values for
irishfurlong    10 irishchain    # these lengths.
irishmile       8 irishfurlong   #

#  Irish area measure

irishrood       40 irishpole^2
irishacre       4 irishrood

!endcategory

# English wine capacity measures (Winchester measures)

!category winchester_wine "Winchester Wine Measures"

winepint       1|2 winequart
winequart      1|4 winegallon
winegallon     231 UKinch^3   # Sometimes called the Winchester Wine Gallon,
                              # it was legalized in 1707 by Queen Anne, and
                              # given the definition of 231 cubic inches.  It
                              # had been in use for a while as 8 pounds of wine
                              # using a merchant's pound, but the definition of
                              # the merchant's pound had become uncertain.  A
                              # pound of 15 tower ounces (6750 grains) had been
                              # common, but then a pound of 15 troy ounces
                              # (7200 grains) gained popularity.  Because of
                              # the switch in the value of the merchants pound,
                              # the size of the wine gallon was uncertain in
                              # the market, hence the official act in 1707.
                              # The act allowed that a six inch tall cylinder
                              # with a 7 inch diameter was a lawful wine
                              # gallon.  (This comes out to 230.9 in^3.)
                              # Note also that in Britain a legal conversion
                              # was established to the 1824 Imperial gallon
                              # then taken as 277.274 in^3 so that the wine
                              # gallon was 0.8331 imperial gallons.  This is
                              # 231.1 cubic inches (using the international
                              # inch).
winerundlet    18 winegallon
winebarrel     31.5 winegallon
winetierce     42 winegallon
winehogshead   2 winebarrel
winepuncheon   2 winetierce
winebutt       2 winehogshead
winepipe       winebutt
winetun        2 winebutt

!endcategory

!category wine "Wine and Spirits Measures"

# English beer and ale measures used 1803-1824 and used for beer before 1688
beerpint       1|2 beerquart
beerquart      1|4 beergallon
beergallon     282 UKinch^3
beerbarrel     36 beergallon
beerhogshead   1.5 beerbarrel

# English ale measures used from 1688-1803 for both ale and beer

alepint        1|2 alequart
alequart       1|4 alegallon
alegallon      beergallon
alebarrel      34 alegallon
alehogshead    1.5 alebarrel

!endcategory

!category scots "Scotland Measures"

# Scots capacity measure

scotsgill      1|4 mutchkin
mutchkin       1|2 choppin
choppin        1|2 scotspint
scotspint      1|2 scotsquart
scotsquart     1|4 scotsgallon
scotsgallon    827.232 UKinch^3
scotsbarrel    8 scotsgallon
jug            scotspint

# Scots dry capacity measure

scotswheatlippy   137.333 UKinch^3    # Also used for peas, beans, rye, salt
scotswheatlippies scotswheatlippy
scotswheatpeck    4 scotswheatlippy
scotswheatfirlot  4 scotswheatpeck
scotswheatboll    4 scotswheatfirlot
scotswheatchalder 16 scotswheatboll

scotsoatlippy     200.345 UKinch^3    # Also used for barley and malt
scotsoatlippies   scotsoatlippy
scotsoatpeck      4 scotsoatlippy
scotsoatfirlot    4 scotsoatpeck
scotsoatboll      4 scotsoatfirlot
scotsoatchalder   16 scotsoatboll

# Scots Tron weight

trondrop       1|16 tronounce
tronounce      1|20 tronpound
tronpound      9520 grain
tronstone      16 tronpound

!endcategory

!category irish "Ireland Measures"

# Irish liquid capacity measure

irishnoggin    1|4 irishpint
irishpint      1|2 irishquart
irishquart     1|2 irishpottle
irishpottle    1|2 irishgallon
irishgallon    217.6 UKinch^3
irishrundlet   18 irishgallon
irishbarrel    31.5 irishgallon
irishtierce    42 irishgallon
irishhogshead  2 irishbarrel
irishpuncheon  2 irishtierce
irishpipe      2 irishhogshead
irishtun       2 irishpipe

# Irish dry capacity measure

irishpeck      2 irishgallon
irishbushel    4 irishpeck
irishstrike    2 irishbushel
irishdrybarrel 2 irishstrike
irishquarter   2 irishbarrel

!endcategory

!category english "English Measurements"

# English Tower weights, abolished in 1528

towerpound       5400 grain
towerounce       1|12 towerpound
towerpennyweight 1|20 towerounce
towergrain       1|32 towerpennyweight

# English Mercantile weights, used since the late 12th century

mercpound      6750 grain
mercounce      1|15 mercpound
mercpennyweight 1|20 mercounce

# English weights for lead

leadstone     12.5 lb
fotmal        70 lb
leadwey       14 leadstone
fothers       12 leadwey

# English Hay measure

newhaytruss 60 lb             # New and old here seem to refer to "new"
newhayload  36 newhaytruss    # hay and "old" hay rather than a new unit
oldhaytruss 56 lb             # and an old unit.
oldhayload  36 oldhaytruss

# English wool measure

woolclove   7 lb
woolstone   2 woolclove
wooltod     2 woolstone
woolwey     13 woolstone
woolsack    2 woolwey
woolsarpler 2 woolsack
woollast    6 woolsarpler

!endcategory

#
# Ancient history units:  There tends to be uncertainty in the definitions
#                         of the units in this section
# These units are from [11]

# Roman measure.  The Romans had a well defined distance measure, but their
# measures of weight were poor.  They adopted local weights in different
# regions without distinguishing among them so that there are half a dozen
# different Roman "standard" weight systems.

!category roman "Roman Measures"

romanfoot    296 mm          # There is some uncertainty in this definition
romanfeet    romanfoot       # from which all the other units are derived.
pes          romanfoot       # This value appears in numerous sources. In "The
pedes        romanfoot       # Roman Land Surveyors", Dilke gives 295.7 mm.
romaninch    1|12 romanfoot  # The subdivisions of the Roman foot have the
romandigit   1|16 romanfoot  #   same names as the subdivisions of the pound,
romanpalm    1|4 romanfoot   #   but we can't have the names for different
romancubit   18 romaninch    #   units.
romanpace    5 romanfeet     # Roman double pace (basic military unit)
passus       romanpace
romanperch   10 romanfeet
stade        125 romanpaces
stadia       stade
stadium      stade
romanmile    8 stadia        # 1000 paces
romanleague  1.5 romanmile
schoenus     4 romanmile

# Other values for the Roman foot (from Dilke)

earlyromanfoot    29.73 cm
pesdrusianus      33.3 cm    # or 33.35 cm, used in Gaul & Germany in 1st c BC
lateromanfoot     29.42 cm

# Roman areas

actuslength  120 romanfeet     # length of a Roman furrow
actus        120*4 romanfeet^2 # area of the furrow
squareactus  120^2 romanfeet^2 # actus quadratus
acnua        squareactus
iugerum      2 squareactus
iugera       iugerum
jugerum      iugerum
jugera       iugerum
heredium     2 iugera          # heritable plot
heredia      heredium
centuria     100 heredia
centurium    centuria

# Roman volumes

sextarius       35.4 in^3      # Basic unit of Roman volume.  As always,
sextarii        sextarius      # there is uncertainty.  Six large Roman
                               # measures survive with volumes ranging from
                               # 34.4 in^3 to 39.55 in^3.  Three of them
                               # cluster around the size given here.
                               #
                               # But the values for this unit vary wildly
                               # in other sources.  One reference  gives 0.547
                               # liters, but then says the amphora is a
                               # cubic Roman foot.  This gives a value for the
                               # sextarius of 0.540 liters.  And the
                               # encyclopedia Brittanica lists 0.53 liters for
                               # this unit.  Both [7] and [11], which were
                               # written by scholars of weights and measures,
                               # give the value of 35.4 cubic inches.
cochlearia      1|48 sextarius
cyathi          1|12 sextarius
acetabula       1|8 sextarius
quartaria       1|4 sextarius
quartarius      quartaria
heminae         1|2 sextarius
hemina          heminae
cheonix         1.5 sextarii

# Dry volume measures (usually)

semodius        8 sextarius
semodii         semodius
modius          16 sextarius
modii           modius

# Liquid volume measures (usually)

congius         12 heminae
congii          congius
amphora         8 congii
amphorae        amphora      # Also a dry volume measure
culleus         20 amphorae
quadrantal      amphora

# Roman weights

libra           5052 grain   # The Roman pound varied significantly
librae          libra        # from 4210 grains to 5232 grains.  Most of
romanpound      libra        # the standards were obtained from the weight
romanuncia      1|12 libra   # of particular coins.  The one given here is
unciae          romanuncia   # based on the Gold Aureus of Augustus which
romanounce      romanuncia   # was in use from BC 27 to AD 296.
deunx           11 uncia
dextans         10 uncia
dodrans         9 uncia
bes             8 uncia
seprunx         7 uncia
semis           6 uncia
quincunx        5 uncia
triens          4 uncia
quadrans        3 uncia
sextans         2 uncia
sescuncia       1.5 uncia
semuncia        1|2 uncia
siscilius       1|4 uncia
sextula         1|6 uncia
semisextula     1|12 uncia
scriptulum      1|24 uncia
scrupula        scriptulum
romanobol       1|2 scrupula

romanaspound    4210 grain    # Old pound based on bronze coinage, the
                              # earliest money of Rome BC 338 to BC 268.

!endcategory

# Egyptian length measure

!category egyptian "Egyptian Measures"

egyptianroyalcubit      20.63 in    # plus or minus .2 in
egyptianpalm            1|7 egyptianroyalcubit
egyptiandigit           1|4 egyptianpalm
egyptianshortcubit      6 egyptianpalm

doubleremen             29.16 in  # Length of the diagonal of a square with
remendigit       1|40 doubleremen # side length of 1 royal egyptian cubit.
                                  # This is divided into 40 digits which are
                                  # not the same size as the digits based on
                                  # the royal cubit.

!endcategory

# Greek length measures

!category greek "Greek Measures"

greekfoot               12.45 in      # Listed as being derived from the
greekfeet               greekfoot     # Egyptian Royal cubit in [11].  It is
greekcubit              1.5 greekfoot # said to be 3|5 of a 20.75 in cubit.
pous                    greekfoot
podes                   greekfoot
orguia                  6 greekfoot
greekfathom             orguia
stadion                 100 orguia
akaina                  10 greekfeet
plethron                10 akaina
greekfinger             1|16 greekfoot
homericcubit            20 greekfingers  # Elbow to end of knuckles.
shortgreekcubit         18 greekfingers  # Elbow to start of fingers.

ionicfoot               296 mm
doricfoot               326 mm

olympiccubit            25 remendigit    # These olympic measures were not as
olympicfoot             2|3 olympiccubit # common as the other greek measures.
olympicfinger           1|16 olympicfoot # They were used in agriculture.
olympicfeet             olympicfoot
olympicdakylos          olympicfinger
olympicpalm             1|4 olympicfoot
olympicpalestra         olympicpalm
olympicspithame         3|4 foot
olympicspan             olympicspithame
olympicbema             2.5 olympicfeet
olympicpace             olympicbema
olympicorguia           6 olympicfeet
olympicfathom           olympicorguia
olympiccord             60 olympicfeet
olympicamma             olympiccord
olympicplethron         100 olympicfeet
olympicstadion          600 olympicfeet

# Greek capacity measure

greekkotyle             270 ml           # This approximate value is obtained
xestes                  2 greekkotyle    # from two earthenware vessels that
khous                   12 greekkotyle   # were reconstructed from fragments.
metretes                12 khous         # The kotyle is a day's corn ration
choinix                 4 greekkotyle    # for one man.
hekteos                 8 choinix
medimnos                6 hekteos

# Greek weight.  Two weight standards were used, an Aegina standard based
# on the Beqa shekel and an Athens (attic) standard.

aeginastater            192 grain        # Varies up to 199 grain
aeginadrachmae          1|2 aeginastater
aeginaobol              1|6 aeginadrachmae
aeginamina              50 aeginastaters
aeginatalent            60 aeginamina    # Supposedly the mass of a cubic foot
                                         # of water (whichever foot was in use)

atticstater             135 grain        # Varies 134-138 grain
atticdrachmae           1|2 atticstater
atticobol               1|6 atticdrachmae
atticmina               50 atticstaters
attictalent             60 atticmina     # Supposedly the mass of a cubic foot
                                         # of water (whichever foot was in use)

!endcategory

# "Northern" cubit and foot.  This was used by the pre-Aryan civilization in
# the Indus valley.  It was used in Mesopotamia, Egypt, North Africa, China,
# central and Western Europe until modern times when it was displaced by
# the metric system.

!category northern_cubic "Northern Cubic and Foot"

northerncubit           26.6 in           # plus/minus .2 in
northernfoot            1|2 northerncubit

sumeriancubit           495 mm
kus                     sumeriancubit
sumerianfoot            2|3 sumeriancubit

assyriancubit           21.6 in
assyrianfoot            1|2 assyriancubit
assyrianpalm            1|3 assyrianfoot
assyriansusi            1|20 assyrianpalm
susi                    assyriansusi
persianroyalcubit       7 assyrianpalm

!endcategory

# Arabic measures.  The arabic standards were meticulously kept.  Glass weights
# accurate to .2 grains were made during AD 714-900.

!category arabic "Arabic Measures"

hashimicubit            25.56 in          # Standard of linear measure used
                                          # in Persian dominions of the Arabic
                                          # empire 7-8th cent.  Is equal to two
                                          # French feet.

blackcubit              21.28 in
arabicfeet              1|2 blackcubit
arabicfoot              arabicfeet
arabicinch              1|12 arabicfoot
arabicmile              4000 blackcubit

silverdirhem            45 grain  # The weights were derived from these two
tradedirhem             48 grain  # units with two identically named systems
                                  # used for silver and used for trade purposes

silverkirat             1|16 silverdirhem
silverwukiyeh           10 silverdirhem
silverrotl              12 silverwukiyeh
arabicsilverpound       silverrotl

tradekirat              1|16 tradedirhem
tradewukiyeh            10 tradedirhem
traderotl               12 tradewukiyeh
arabictradepound        traderotl

!endcategory

# Miscellaneous ancient units

parasang                3.5 mile # Persian unit of length usually thought
                                 # to be between 3 and 3.5 miles
biblicalcubit           21.8 in
hebrewcubit             17.58 in
li                      10|27.8 mile  # Chinese unit of length
                                      #   100 li is considered a day's march
liang                   11|3 oz       # Chinese weight unit


# Medieval time units.  According to the OED, these appear in Du Cange
# by Papias.

timepoint               1|5 hour  # also given as 1|4
timeminute              1|10 hour
timeostent              1|60 hour
timeounce               1|8 timeostent
timeatom                1|47 timeounce

# Given in [15], these subdivisions of the grain were supposedly used
# by jewelers.  The mite may have been used but the blanc could not
# have been accurately measured.

mite                    1|20 grain
droit                   1|24 mite
periot                  1|20 droit
blanc                   1|24 periot

#
# Localization
#

!var UNITS_ENGLISH US
hundredweight           ushundredweight
ton                     uston
scruple                 apscruple
fluidounce              usfluidounce
gallon                  usgallon
bushel                  usbushel
quarter                 quarterweight
cup                     uscup
tablespoon              ustablespoon
teaspoon                usteaspoon
minim                   minimvolume
pony                    ponyvolume
firkin                  usfirkin
hogshead                ushogshead
!endvar

# !var UNITS_ENGLISH GB
# hundredweight           brhundredweight
# ton                     brton
# scruple                 brscruple
# fluidounce              brfluidounce
# gallon                  brgallon
# bushel                  brbushel
# quarter                 brquarter
# chaldron                brchaldron
# cup                     brcup
# teacup                  brteacup
# tablespoon              brtablespoon
# teaspoon                brteaspoon
# penny                   brpenny
# minim                   minimnote
# pony                    brpony
# grand                   brgrand
# firkin                  brfirkin
# hogshead                brhogshead
# !endvar

!varnot UNITS_ENGLISH GB US
!message Unknown value for environment variable UNITS_ENGLISH.  Should be GB or US.
!endvar


!utf8
⅛-                      1|8
¼-                      1|4
⅜-                      3|8
½-                      1|2
⅝-                      5|8
¾-                      3|4
⅞-                      7|8
⅙-                      1|6
⅓-                      1|3
⅔-                      2|3
⅚-                      5|6
⅕-                      1|5
⅖-                      2|5
⅗-                      3|5
⅘-                      4|5
# U+2150-               1|7  For some reason these characters are getting
# U+2151-               1|9  flagged as invalid UTF8.
# U+2152-               1|10
ℯ                       2.71828182845904523536 #exp(1)      # U+212F, base of natural log
e                       ℯ

µ-                      micro       # micro sign U+00B5
μ-                      micro       # small mu U+03BC
ångström                angstrom
Å                       angstrom    # angstrom symbol U+212B
Å                       angstrom    # A with ring U+00C5
röntgen                 roentgen
#°C                      degC
#°F                      degF
°K                      K           # °K is incorrect notation
°R                      degR
°                       degree
#℃                       degC
#℉                       degF
K                       K          # Kelvin symbol, U+212A
ℓ                       liter      # unofficial abbreviation used in some places

Ω                       ohm       # Ohm symbol U+2126
Ω                       ohm       # Greek capital omega U+03A9
℧                       mho
ʒ                        dram     # U+0292
℈                       scruple
℥                       ounce
℔                       lb
ℎ                       planck_constant
ℏ                       hbar
ħ                       hbar
‰                       1|1000
‱                       1|10000
#′                       '        # U+2032
#″                       "        # U+2033

#
# Square unicode symbols starting at U+3371
#

㍱                      hPa
㍲                      da
㍳                      au
㍴                      bar
# ㍵                          oV???
㍶                      pc
#㍷                      dm      invalid on Mac
#㍸                      dm^2    invalid on Mac
#㍹                      dm^3    invalid on Mac
㎀                      pA
㎁                      nA
㎂                      µA
㎃                      mA
㎄                      kA
㎅                      kB
㎆                      MB
㎇                      GB
㎈                      cal
㎉                      kcal
㎊                      pF
㎋                      nF
㎌                      µF
㎍                      µg
㎎                      mg
㎏                      kg
㎐                      Hz
㎑                      kHz
㎒                      MHz
㎓                      GHz
㎔                      THz
㎕                      µL
㎖                      mL
㎗                      dL
㎘                      kL
㎙                      fm
㎚                      nm
㎛                      µm
㎜                      mm
㎝                      cm
㎞                      km
㎟                      mm^2
㎠                      cm^2
㎡                      m^2
㎢                      km^2
㎣                      mm^3
㎤                      cm^3
㎥                      m^3
㎦                      km^3
㎧                      m/s
㎨                      m/s^2
㎩                      Pa
㎪                      kPa
㎫                      MPa
㎬                      GPa
㎭                      rad
㎮                      rad/s
㎯                      rad/s^2
㎰                      ps
㎱                      ns
㎲                      µs
㎳                      ms
㎴                      pV
㎵                      nV
㎶                      µV
㎷                      mV
㎸                      kV
㎹                      MV
㎺                      pW
㎻                      nW
㎼                      µW
㎽                      mW
㎾                      kW
㎿                      MW
㏀                      kΩ
㏁                      MΩ
㏃                      Bq
㏄                      cc
㏅                      cd
㏆                      C/kg
#㏈()                    dB
㏉                      Gy
㏊                      ha
# ㏋  HP??
㏌                      in
# ㏍                      KK??
# ㏎                      KM???
㏏                      kt
㏐                      lm
# ㏑                      ln
# ㏒                      log
㏓                      lx
㏔                      mb
㏕                      mil
㏖                      mol
#㏗()                    pH
㏙                      ppm
#   ㏚     PR???
㏛                      sr
㏜                      Sv
㏝                      Wb
#㏞                      V/m     Invalid on Mac
#㏟                      A/m     Invalid on Mac
#㏿                      gal     Invalid on Mac

!endutf8

############################################################################
#
# Substances
#
############################################################################

#
# Assorted
#

!category substances "Substances"

water {
    density             mass gram / volume cm^3
    pressure_column     pressure gram force cm^-2 / column cm
    specific_heat       specific_energy calorie g^-1 / temperature K
    fusion_heat         fusion_energy 79.8 calorie / fusion_mass gram
    vaporization_heat   vaporization_energy 1160 J / vaporization_mass gram

    pressure_column_0C   pressure_0C   0.99987 force gram cm^-2 / column_0C   cm
    pressure_column_5C   pressure_5C   0.99999 force gram cm^-2 / column_5C   cm
    pressure_column_10C  pressure_10C  0.99973 force gram cm^-2 / column_10C  cm
    pressure_column_15C  pressure_15C  0.99913 force gram cm^-2 / column_15C  cm
    pressure_column_18C  pressure_18C  0.99862 force gram cm^-2 / column_18C  cm
    pressure_column_20C  pressure_20C  0.99823 force gram cm^-2 / column_20C  cm
    pressure_column_25C  pressure_25C  0.99707 force gram cm^-2 / column_25C  cm
    pressure_column_50C  pressure_50C  0.98807 force gram cm^-2 / column_50C  cm
    pressure_column_100C pressure_100C 0.95838 force gram cm^-2 / column_100C cm
}

H2O                     water
wc                      pressure_column of water
mmH2O                   pressure of mm water
inH2O                   pressure of inch water

!symbol mercury Hg
mercury {
    density             mass 13.5951 gram / volume cm^3
    pressure_column     pressure 13.5951 gram force cm^-2 / column cm
    specific_heat       specific_energy 0.14 J g^-1 / temperature K
    molar_mass          mass 200.59 g / amount mol

    # These units, when used to form
    # pressure measures, are not accurate
    # because of considerations of the
    # revised practical temperature scale.
    pressure_column_10C pressure_10C 13.5708 force gram cm^-2 / column_10C cm
    pressure_column_20C pressure_20C 13.5462 force gram cm^-2 / column_20C cm
    pressure_column_23C pressure_23C 13.5386 force gram cm^-2 / column_23C cm
    pressure_column_30C pressure_30C 13.5217 force gram cm^-2 / column_30C cm
    pressure_column_40C pressure_40C 13.4973 force gram cm^-2 / column_40C cm
    pressure_column_60F pressure_60F 13.5574 force gram cm^-2 / column_60F cm
}

Hg                      mercury
mmHg                    pressure of mm mercury
inHg                    pressure of inch mercury

ammonia {
    specific_heat       specific_energy 4.6 J g^-1 / temperature K
}

NH3                     ammonia

freon {
    ?? R-12 at 0 degrees Fahrenheit.
    specific_heat       specific_energy 0.91 J g^-1 / temperature K
}

tissue {
    specific_heat       specific_energy 3.5 J g^-1 / temperature K
}

diamond {
    specific_heat       specific_energy 0.5091 J g^-1 / temperature K
}

granite {
    specific_heat       specific_energy 0.79 J g^-1 / temperature K
}

graphite {
    specific_heat       specific_energy 0.71 J g^-1 / temperature K
}

ice {
    specific_heat       specific_energy 2.11 J g^-1 / temperature K
}

asphalt {
    specific_heat       specific_energy 0.92 J g^-1 / temperature K
}

brick {
    specific_heat       specific_energy 0.84 J g^-1 / temperature K
}

concrete {
    specific_heat       specific_energy 0.88 J g^-1 / temperature K
}

glass_silica {
    specific_heat       specific_energy 0.84 J g^-1 / temperature K
}

glass_flint {
    specific_heat       specific_energy 0.503 J g^-1 / temperature K
}

glass_pyrex {
    specific_heat       specific_energy 0.753 J g^-1 / temperature K
}

gypsum {
    specific_heat       specific_energy 1.09 J g^-1 / temperature K
}

marble {
    specific_heat       specific_energy 0.88 J g^-1 / temperature K
}

sand {
    specific_heat       specific_energy 0.835 J g^-1 / temperature K
}

soil {
    specific_heat       specific_energy 0.835 J g^-1 / temperature K
}

#
# Fundamental particles
#

# particle wavelengths: the compton wavelength of a particle is
# defined as h / m c where m is the mass of the particle.

electron {
    mass                const electron_mass         5.48579909070e-4 u
    charge              const electron_charge       1.6021766208e-19 C
    radius              const electron_radius       ((1/4 pi epsilon0) \
                                                    charge^2 / mass c^2)
    wavelength          const electron_wavelength   planck_constant / mass c
    magnetic_moment     const electron_moment       -928.4764620e-26 J/T
}

electronmass            mass of electron
electroncharge          charge of electron
m_e                     electronmass

proton {
    mass                const proton_mass           1.007276466879 u
    wavelength          const proton_wavelength     planck_constant / mass c
    charge_radius       const proton_radius         0.8751e-15 m
    magnetic_moment     const proton_moment         1.4106067873e-26 J/T
}

m_p                     mass of proton

neutron {
    mass                const neutron_mass          1.00866491588 u
    wavelength          const neutron_wavelength    planck_constant / mass c
    magnetic_moment     const neutron_moment        -0.96623650e-26 J/T
}

m_n                     mass of neutron

deuteron {
    mass                const deuteron_mass         2.013553212745 u
    charge_radius       const deuteron_radius       2.1413e-15 m
    magnetic_moment     const deuteron_moment       0.4330735040e-26 J/T
}

m_d                     mass of deuteron

muon {
    mass                const muon_mass             0.1134289257 u
    magnetic_moment     const muon_moment           -4.49044826e-26 J/T
}

m_mu                    mass of muon

helion {
    mass                const helion_mass           3.01493224673 u
    magnetic_moment     const helion_moment         -1.074617522e-26 J/T
}

tauparticle {
    mass                const tau_mass              1.90749 u
}

alphaparticle {
    mass                const alpha_mass            4.001506179127 u
}

triton {
    mass                const triton_mass           3.01550071632 u
    magnetic_moment     const triton_moment         1.504609503e-26 J/T
}

light {
    speed               const light_speed           2.99792458e8 m/s
}

#
# Celestial bodies
#

# Sidereal years from http://ssd.jpl.nasa.gov/phys_props_planets.html.  Data
# was updated in May 2001 based on the 1992 Explanatory Supplement to the
# Astronomical Almanac and the mean longitude rates.  Apparently the table of
# years in that reference is incorrect.

# The following are masses for planetary systems, not just the planet itself.
# The comments give the uncertainty in the denominators.  As noted above,
# masses are given relative to the solarmass because this is more accurate.
# The conversion to SI is uncertain because of uncertainty in G, the
# gravitational constant.
#
# Values are from http://ssd.jpl.nasa.gov/astro_constants.html

# Mean radius from http://ssd.jpl.nsaa.gov/phys_props_planets.html which in
# turn cites Global Earth Physics by CF Yoder, 1995.

sun {
    mass                const solar_mass        1.9891e30 kg
    ?? Average earth-sun distance
    distance            const sun_distance      1.0000010178 au
    ?? Earth-sun distance at periphelion
    distance_near       const sun_distance_near 1.471e11 m
    ?? Earth-sun distance at aphelion
    distance_far        const sun_distance_far  1.521e11 m
    radius_equatorial   const sun_radius        695700 km
    volume              const sun_volume        1.41e18 km^3
    ?? Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html
    luminosity          const solar_luminosity  384.6e24 W

    # Some luminance data from the IES Lighting Handbook, 8th ed, 1993

    ?? Clear sky.
    illum_zenith        const sun_illum_zenith  100e3 lux
    illum_overcast      const sun_illum_overcast 10e3 lux
    luminance_zenith    const sun_lum_zenith    1.6e9 cd/m^2
    luminance_horizon   const sun_lum_horizon   6e6 cd/m^2
    ?? Average, clear sky.
    luminance_clear     const sun_lum_clear     8000 cd/m^2
    ?? Average, overcast sky.
    luminance_overcast  const sun_lum_overcast  2000 cd/m^2
}

solarmass               mass of sun
sunmass                 solarmass
sundist                 distance of sun
solarluminosity         luminosity of sun

mercury_planet {
    ?? ±250
    mass                const mercury_mass      solarmass / 6023600
    mass_old            const mercury_old       0.33022e24 kg
    radius              const mercury_radius    2440 km
    volume              const mercury_volume    6.083e10 km^3
    sidereal_day        const mercury_day       58.6462 day
    year                const mercury_year      0.2408467 julianyear
}

venus {
    ?? ± 0.06
    mass                const venus_mass        solarmass / 408523.71
    mass_old            const venus_old         4.8690e24 kg
    radius              const venus_radius      6051.84 km
    volume              const venus_volume      9.2843e11 km^3
    ?? Retrograde.
    sidereal_day        const venus_day         243.01 day
    year                const venus_year        0.61519726 julianyear
}

?? ±0.02
earthmoonmass           solarmass / 328900.56
?? ±3e-9
moonearthmassratio      0.012300034

earth {
    mass                const earth_mass        earthmoonmass / ( 1 + moonearthmassratio)
    radius              const earth_radius      6371.01 km
    volume              const earth_volume      1.08321e12 km^3
    sidereal_day        const earth_day         siderealday
    year                const earth_year        siderealyear
}

moon {
    ?? Average earth-moon distance.
    mass                const moon_mass         moonearthmassratio mass of earth
    radius              const moon_radius       1737.1 km
    volume              const moon_volume       2.1958e10 km^3
    distance            const moon_dist         3.844e8 m
    gravity             const moon_gravity      1.62 m/s^2
    luminance           const moon_luminance    2500 cd/m^2
}

mars {
    ?? ±9
    mass                const mars_mass         solarmass / 3098708
    mass_old            const mars_old          0.64191e24 kg
    radius              const mars_radius       3389.92 km
    volume              const mars_volume       1.6318e11 km^3
    sidereal_day        const mars_day          1.02595675 day
    year                const mars_year         1.8808476 julianyear
}

jupiter {
    ?? ±0.0008
    mass                const jupiter_mass      solarmass / 1047.3486
    mass_old            const jupiter_old       1898.8e24 kg
    radius              const jupiter_radius    69911 km
    volume              const jupiter_volume    1.4313e15 km^3
    sidereal_day        const jupiter_day       0.41354 day
    year                const jupiter_year      11.862615 julianyear
}

saturn {
    ?? ±0.018
    mass                const saturn_mass       solarmass / 3497.898
    mass_old            const saturn_old        568.5e24 kg
    radius              const saturn_radius     58232 km
    volume              const saturn_volume     8.2713e14 km^3
    sidereal_day        const saturn_day        0.4375 day
    year                const saturn_year       29.447498 julianyear
}

uranus {
    ?? ±0.03
    mass                const uranus_mass       solarmass / 22902.98
    mass_old            const uranus_old        86.625e24 kg
    radius              const uranus_radius     25362 km
    volume              const uranus_volume     6.833e13 km^3
    ?? Retrograde.
    sidereal_day        const uranus_day        0.65 day
    year                const uranus_year       84.016846 julianyear
}

neptune {
    ?? ±0.04
    mass                const neptune_mass      solarmass / 19412.24
    mass_old            const neptune_old       102.78e24 kg
    radius              const neptune_radius    24624 km
    volume              const neptune_volume    6.254e13 km^3
    sidereal_day        const neptune_day       0.768 day
    year                const neptune_year      164.79132 julianyear
}

pluto {
    ?? ±0.07e8
    mass                const pluto_mass        solarmass / 1.35e8
    mass_old            const pluto_old         0.015e24 kg
    radius              const pluto_radius      1151 km
    ?? ±0.071e9 km^3
    volume              const pluto_volume      7.006e9 km^3
    sidereal_day        const pluto_day         6.3867 day
    year                const pluto_year        247.92065 julianyear
}

#
# Energy densities of various fuels
#
# Most of these fuels have varying compositions or qualities and hence their
# actual energy densities vary.  These numbers are hence only approximate.
#
# E1. http://bioenergy.ornl.gov/papers/misc/energy_conv.html
# E2. http://www.aps.org/policy/reports/popa-reports/energy/units.cfm
# E3. http://www.ior.com.au/ecflist.html

oil {
    ?? Ton oil equivalent.  A conventional
    ?? value for the energy released by
    ?? burning one metric ton of oil. [18,E2]
    ?? Note that energy per mass of petroleum
    ?? products is fairly constant.
    ?? Variations in volumetric energy
    ?? density result from variations in the
    ?? density (kg/m^3) of different fuels.
    ?? This definition is given by the
    ?? IEA/OECD.
    specific_energy     energy 1e10 cal_IT / mass ton
}

tonoil                  energy of ton oil
toe                     tonoil
?? Conventional value for barrel of crude
?? oil [E2].  Actual range is 5.6 - 6.3.
barreloil               5.8 Mbtu

coal {
    ?? Energy in metric ton coal from [18].
    ?? This is a nominal value which
    ?? is close to the heat content
    ?? of coal used in the 1950's.
    specific_energy             energy 7e9 cal_IT / mass ton
    specific_energy_bituminous  energy_bituminous 27 GJ / mass_bituminous tonne
    specific_energy_lignite     energy_lignite 15 GJ / mass_lignite tonne
    specific_energy_us          energy_us 22 GJ / mass_us uston
}

naturalgas {
    ?? Energy content of natural gas.  HHV
    ?? is for Higher Heating Value and
    ?? includes energy from condensation
    ?? combustion products.  LHV is for Lower
    ?? Heating Value and excludes these.
    ?? American publications typically report
    ?? HHV whereas European ones report LHV.
    energy_density_HHV  energy_HHV 1027 btu / volume_HHV ft^3
    energy_density_LHV  energy_LHV 930 btu / volume_LHV ft^3
}

charcoal {
    specific_energy     energy 30 GJ / mass tonne
}

wood {
    ?? HHV, a cord weights about a tonne.
    specific_energy_dry         energy_dry 20 GJ / mass_dry tonne
    ?? 20% moisture content.
    specific_energy_airdry      energy_airdry 15 GJ / mass_airdry tonne
    specific_heat               specific_energy 1.7 J g^-1 / temperature K
}

ethanol {
    energy_density_HHV  energy_HHV 84000 btu / volume_HHV usgallon
    energy_density_LHV  energy_LHV 75700 btu / volume_LHV usgallon
    specific_heat       specific_energy 2.3 J g^-1 / temperature K
}

diesel {
    energy_density      energy 130500 btu / volume usgallon
}

gasoline {
    energy_density_LHV  energy_LHV 115000 btu / volume_LHV usgallon
    energy_density_HHV  energy_HHV 125000 btu / volume_HHV usgallon
    specific_heat       specific_energy 2.22 J g^-1 / temperature K
}

heating_oil {
    energy_density      energy 37.3 MJ / volume liter
}

fueloil {
    ?? Low sulphur.
    energy_density      energy 39.7 MJ / volume liter
}

propane {
    energy_density      energy 93.3 MJ / volume m^3
}

butane {
    energy_density      energy 124 MJ / volume m^3
}

# densities of cooking ingredients from The Cake Bible by Rose Levy Beranbaum
# so you can convert '2 cups sugar' to grams, for example, or in the other
# direction grams could be converted to 'cup flour_scooped'.

butter {
    density             mass 8 oz / volume uscup
}

butter_clarified {
    density             mass 6.8 oz / volume uscup
}

cocoa_butter {
    density             mass 9 oz / volume uscup
}

?? Vegetable shortening.
shortening {
    density             mass 6.75 oz / volume uscup
}

vegetable_oil {
    density             mass 7.5 oz / volume uscup
}

olive_oil {
    density             mass 0.918 g / volume cm^3
    specific_heat       specific_energy 1.97 J g^-1 / temperature K
}

# The density of flour depends on the
# measuring method.  "Scooped",  or
# "dip and sweep" refers to dipping a
# measure into a bin, and then sweeping
# the excess off the top.  "Spooned"
# means to lightly spoon into a measure
# and then sweep the top.  Sifted means
# sifting the flour directly into a
# measure and then sweeping the top.

cakeflour {
    density_sifted      mass_sifted 3.5 oz / volume_sifted uscup
    density_spooned     mass_spooned 4 oz / volume_spooned uscup
    density_scooped     mass_scooped 4.5 oz / volume_scooped uscup
}

flour {
    density_sifted      mass_sifted 4 oz / volume_sifted uscup
    density_spooned     mass_spooned 4.25 oz / volume_spooned uscup
    density_scooped     mass_scooped 5 oz / volume_scooped uscup
}

breadflour {
    density_sifted      mass_sifted 4.25 oz / volume_sifted uscup
    density_spooned     mass_spooned 4.5 oz / volume_spooned uscup
    density_scooped     mass_scooped 5.5 oz / volume_scooped uscup
}

cornstarch {
    density             mass 120 grams / volume uscup
}

?? Alkalized Dutch processed cocoa.
dutchcocoa {
    density_sifted      mass_sifted 75 g / volume_sifted uscup
    density_spooned     mass_spooned 92 g / volume_spooned uscup
    density_scooped     mass_scooped 95 g / volume_scooped uscup
}

?? Non-alkalized cocoa.
cocoa {
    density_sifted      mass_sifted 75 g / volume_sifted uscup
    density_spooned     mass_spooned 82 g / volume_spooned uscup
    density_scooped     mass_scooped 95 g / volume_scooped uscup
}

heavycream {
    density             mass 232 g / volume uscup
}

milk {
    density             mass 242 g / volume uscup
}

sourcream {
    density             mass 242 g / volume uscup
}

molasses {
    density             mass 11.25 oz / volume uscup
}

cornsyrup {
    density             mass 11.5 oz / volume uscup
}

honey {
    density             mass 11.75 oz / volume uscup
}

sugar {
    density             mass 200 g / volume uscup
    specific_heat       specific_energy 1.244 J g^-1 / temperature K
}

powdered_sugar {
    density             mass 4 oz / volume uscup
}

brownsugar_light {
    ?? Packed.
    density             mass 217 g / volume uscup
}

brownsugar_dark {
    density             mass 239 g / volume uscup
}

baking_powder {
    density             mass 4.6 grams / volume ustsp
}

salt {
    density             mass 6 g / volume ustsp
}

koshersalt {
    ?? Diamond Crystal kosher salt
    density_dc           dc_mass 2.8 g / dc_volume ustsp
    ?? Morton kosher salt
    density_morton       morton_mass 4.8 g / morton_volume ustsp
}

?? USA large egg.
egg {
    mass_shelled        const egg_shelled  50 grams
    mass_white          const egg_white    30 grams
    mass_yolk           const egg_yolk     18.6 grams
    volume              const egg_volume   (3 ustbsp + 1|2 ustsp)
    volume_white        const egg_white    2 tbsp
    volume_yolk         const egg_yolk     3.5 ustsp
}

#
# Atomic weights.  The atomic weight of an element is the ratio of the mass of
# a mole of the element to 1|12 of a mole of Carbon 12.  The Standard Atomic
# Weights apply to the elements as they occur naturally on earth.  Elements
# which do not occur naturally or which occur with wide isotopic variability do
# not have Standard Atomic Weights.  For these elements, the atomic weight is
# based on the longest lived isotope, as marked in the comments.  In some
# cases, the comment for these entries also gives a number which is an atomic
# weight for a different isotope that may be of more interest than the longest
# lived isotope.
#

actinium {
    molar_mass      mass 227.0278 g / amount mol
}

!symbol aluminum Al
aluminum {
    molar_mass      mass 26.981539 g / amount mol
    specific_heat   specific_energy 0.91 J g^-1 / temperature K
}

americium {
    ?? Longest lived. 241.06
    molar_mass      mass 243.0614 g / amount mol
}

!symbol antimony Sb
antimony {
    molar_mass      mass 121.760 g / amount mol
    specific_heat   specific_energy 0.21 J g^-1 / temperature K
}

!symbol argon Ar
argon {
    molar_mass      mass 39.948 g / amount mol
    specific_heat   specific_energy 0.5203 J g^-1 / temperature K
}

!symbol arsenic As
arsenic {
    molar_mass      mass 74.92159 g / amount mol
}

astatine {
    ?? Longest lived.
    molar_mass      mass 209.9871 g / amount mol
}

!symbol barium Ba
barium {
    molar_mass      mass 137.327 g / amount mol
    specific_heat   specific_energy 0.20 J g^-1 / temperature K
}

berkelium {
    ?? Longest lived. 249.08
    molar_mass      mass 247.0703 g / amount mol
}

!symbol beryllium Be
beryllium {
    molar_mass      mass 9.012182 g / amount mol
    specific_heat   specific_energy 1.83 J g^-1 / temperature K
}

!symbol bismuth Bi
bismuth {
    molar_mass      mass 208.98037 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

bohrium {
    molar_mass      mass 272.13826 g / amount mol
}

!symbol boron B
boron {
    molar_mass      mass 10.811 g / amount mol
}

!symbol bromine Br
bromine {
    molar_mass      mass 79.904 g / amount mol
}

!symbol cadmium Cd
cadmium {
    molar_mass      mass 112.411 g / amount mol
    specific_heat   specific_energy 0.23 J g^-1 / temperature K
}

!symbol calcium Ca
calcium {
    molar_mass      mass 40.078 g / amount mol
}

californium {
    ?? Longest lived. 252.08
    molar_mass      mass 251.0796 g / amount mol
}

!symbol carbon C
carbon {
    molar_mass      mass 12.011 g / amount mol
}

!symbol cerium Ce
cerium {
    molar_mass      mass 140.115 g / amount mol
}

!symbol cesium Cs
cesium {
    molar_mass      mass 132.90543 g / amount mol
    specific_heat   specific_energy 0.24 J g^-1 / temperature K
}

!symbol chlorine Cl
chlorine {
    molar_mass      mass 35.4527 g / amount mol
}

!symbol chromium Cr
chromium {
    molar_mass      mass 51.9961 g / amount mol
    specific_heat   specific_energy 0.46 J g^-1 / temperature K
}

!symbol cobalt Co
cobalt {
    molar_mass      mass 58.93320 g / amount mol
    specific_heat   specific_energy 0.42 J g^-1 / temperature K
}

copernicium {
    molar_mass      mass 285.17712 g / amount mol
}

!symbol copper Cu
copper {
    molar_mass      mass 63.546 g / amount mol
    specific_heat   specific_energy 0.39 J g^-1 / temperature K
}

curium {
    molar_mass      mass 247.0703 g / amount mol
}

darmstadtium {
    molar_mass      mass 281.16451 g / amount mol
}

!symbol deuterium D
deuterium {
    molar_mass      mass 2.0141017778 g / amount mol
}

dubnium {
    molar_mass      mass 268.12567 g / amount mol
}

!symbol dysprosium Dy
dysprosium {
    molar_mass      mass 162.50 g / amount mol
}

einsteinium {
    ?? Longest lived.
    molar_mass      mass 252.083 g / amount mol
}

!symbol erbium Er
erbium {
    molar_mass      mass 167.26 g / amount mol
}

!symbol europium Eu
europium {
    molar_mass      mass 151.965 g / amount mol
}

fermium {
    ?? Longest lived.
    molar_mass      mass 257.0951 g / amount mol
}

flerovium {
    molar_mass      mass 289.19042 g / amount mol
}

!symbol fluorine F
fluorine {
    molar_mass      mass 18.9984032 g / amount mol
}

francium {
    ?? Longest lived
    molar_mass      mass 223.0197 g / amount mol
}

!symbol gadolinium Gd
gadolinium {
    molar_mass      mass 157.25 g / amount mol
}

!symbol gallium Ga
gallium {
    molar_mass      mass 69.723 g / amount mol
    specific_heat   specific_energy 0.37 J g^-1 / temperature K
}

!symbol germanium Ge
germanium {
    molar_mass      mass 72.61 g / amount mol
    specific_heat   specific_energy 0.32 J g^-1 / temperature K
}

!symbol gold Au
gold {
    molar_mass      mass 196.96654 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol hafnium Hf
hafnium {
    molar_mass      mass 178.49 g / amount mol
    specific_heat   specific_energy 0.14 J g^-1 / temperature K
}

hassium {
    molar_mass      mass 270.13429 g / amount mol
}

!symbol helium He
helium {
    molar_mass      mass 4.002602 g / amount mol
}

!symbol holmium Ho
holmium {
    molar_mass      mass 164.93032 g / amount mol
    specific_heat   specific_energy 5.1932 J g^-1 / temperature K
}

!symbol hydrogen H
hydrogen {
    molar_mass      mass 1.00794 g / amount mol
    specific_heat   specific_energy 14.3 J g^-1 / temperature K
}

!symbol indium In
indium {
    molar_mass      mass 114.818 g / amount mol
    specific_heat   specific_energy 0.24 J g^-1 / temperature K
}

!symbol iodine I
iodine {
    molar_mass      mass 126.90447 g / amount mol
    specific_heat   specific_energy 2.15 J g^-1 / temperature K
}

!symbol iridium Ir
iridium {
    molar_mass      mass 192.217 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol iron Fe
iron {
    molar_mass      mass 55.845 g / amount mol
    specific_heat   specific_energy 0.45 J g^-1 / temperature K
}

!symbol krypton Kr
krypton {
    molar_mass      mass 83.80 g / amount mol
}

!symbol lanthanum La
lanthanum {
    molar_mass      mass 138.9055 g / amount mol
    specific_heat   specific_energy 0.195 J g^-1 / temperature K
}

lawrencium {
    ?? Longest lived.
    molar_mass      mass 262.11 g / amount mol
}

!symbol lead Pb
lead {
    molar_mass      mass 207.2 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol lithium Li
lithium {
    molar_mass      mass 6.941 g / amount mol
    specific_heat   specific_energy 3.57 J g^-1 / temperature K
}

livermorium {
    molar_mass      mass 293.20449 g / amount mol
}

!symbol lutetium Lu
lutetium {
    molar_mass      mass 174.967 g / amount mol
    specific_heat   specific_energy 0.15 J g^-1 / temperature K
}

!symbol magnesium Mg
magnesium {
    molar_mass      mass 24.3050 g / amount mol
    specific_heat   specific_energy 1.05 J g^-1 / temperature K
}

!symbol manganese Mn
manganese {
    molar_mass      mass 54.93805 g / amount mol
    specific_heat   specific_energy 0.48 J g^-1 / temperature K
}

meitnerium {
    molar_mass      mass 276.15159 g / amount mol
}

mendelevium {
    ?? Longest lived
    molar_mass      mass 258.10 g / amount mol
}

!symbol molybdenum Mo
molybdenum {
    molar_mass      mass 95.94 g / amount mol
    specific_heat   specific_energy 0.25 J g^-1 / temperature K
}

!symbol neodymium Nd
neodymium {
    molar_mass      mass 144.24 g / amount mol
}

!symbol neon Ne
neon {
    molar_mass      mass 20.1797 g / amount mol
}

neptunium {
    molar_mass      mass 237.0482 g / amount mol
}

!symbol nickel Ni
nickel {
    molar_mass      mass 58.6934 g / amount mol
    specific_heat   specific_energy 0.44 J g^-1 / temperature K
}

!symbol niobium Nb
niobium {
    molar_mass      mass 92.90638 g / amount mol
}

!symbol nitrogen N
nitrogen {
    molar_mass      mass 14.00674 g / amount mol
}

nobelium {
    ?? Longest lived.
    molar_mass      mass 259.1009 g / amount mol
}

!symbol osmium Os
osmium {
    molar_mass      mass 190.23 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol oxygen O
oxygen {
    molar_mass      mass 15.9994 g / amount mol
}

!symbol palladium Pa
palladium {
    molar_mass      mass 106.42 g / amount mol
    specific_heat   specific_energy 0.24 J g^-1 / temperature K
}

!symbol phosphorus P
phosphorus {
    molar_mass      mass 30.973762 g / amount mol
}

!symbol platinum Pt
platinum {
    molar_mass      mass 195.08 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol plutonium Pu
plutonium {
    ?? Longest lived. 239.05
    molar_mass      mass 244.0642 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

polonium {
    ?? Longest lived. 209.98
    molar_mass      mass 208.9824 g / amount mol
}

!symbol potassium K
potassium {
    molar_mass      mass 39.0983 g / amount mol
    specific_heat   specific_energy 0.75 J g^-1 / temperature K
}

!symbol praseodymium Pr
praseodymium {
    molar_mass      mass 140.90765 g / amount mol
}

promethium {
    ?? Longest lived. 146.92
    molar_mass      mass 144.9127 g / amount mol
}

protactinium {
    molar_mass      mass 231.03588 g / amount mol
}

radium {
    molar_mass      mass 226.0254 g / amount mol
}

radon {
    ?? Longest lived.
    molar_mass      mass 222.0176 g / amount mol
}

!symbol rhenium Re
rhenium {
    molar_mass      mass 186.207 g / amount mol
    specific_heat   specific_energy 0.14 J g^-1 / temperature K
}

!symbol rhodium Rh
rhodium {
    molar_mass      mass 102.90550 g / amount mol
    specific_heat   specific_energy 0.24 J g^-1 / temperature K
}

roentgenium {
    molar_mass      mass 280.16514 g / amount mol
}

!symbol rubidium Rb
rubidium {
    molar_mass      mass 85.4678 g / amount mol
    specific_heat   specific_energy 0.36 J g^-1 / temperature K
}

!symbol ruthenium Ru
ruthenium {
    molar_mass      mass 101.07 g / amount mol
    specific_heat   specific_energy 0.24 J g^-1 / temperature K
}

rutherfordium {
    molar_mass      mass 267.12179 g / amount mol
}

!symbol samarium Sm
samarium {
    molar_mass      mass 150.36 g / amount mol
}

!symbol scandium Sc
scandium {
    molar_mass      mass 44.955910 g / amount mol
    specific_heat   specific_energy 0.57  J g^-1 / temperature K
}

seaborgium {
    molar_mass      mass 271.13393 g / amount mol
}

!symbol selenium Se
selenium {
    molar_mass      mass 78.96 g / amount mol
    specific_heat   specific_energy 0.32 J g^-1 / temperature K
}

!symbol silicon Si
silicon {
    molar_mass      mass 28.0855 g / amount mol
    specific_heat   specific_energy 0.71 J g^-1 / temperature K
}

!symbol silver Ag
silver {
    molar_mass      mass 107.8682 g / amount mol
    specific_heat   specific_energy 0.23 J g^-1 / temperature K
}

!symbol sodium Na
sodium {
    molar_mass      mass 22.989768 g / amount mol
    specific_heat   specific_energy 1.21 J g^-1 / temperature K
}

!symbol strontium Sr
strontium {
    molar_mass      mass 87.62 g / amount mol
    specific_heat   specific_energy 0.30 J g^-1 / temperature K
}

!symbol sulfur S
sulfur {
    molar_mass      mass 32.066 g / amount mol
}

!symbol tantalum Ta
tantalum {
    molar_mass      mass 180.9479 g / amount mol
    specific_heat   specific_energy 0.14 J g^-1 / temperature K
}

technetium {
    ?? Longest lived. 98.906
    molar_mass      mass 97.9072 g / amount mol
}

!symbol tellurium Te
tellurium {
    molar_mass      mass 127.60 g / amount mol
}

!symbol terbium Tb
terbium {
    molar_mass      mass 158.92534 g / amount mol
}

!symbol thallium Tl
thallium {
    molar_mass      mass 204.3833 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol thorium Th
thorium {
    molar_mass      mass 232.0381 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

!symbol thullium Tm
thullium {
    molar_mass      mass 168.93421 g / amount mol
}

!symbol tin Sn
tin {
    molar_mass      mass 118.710 g / amount mol
    specific_heat   specific_energy 0.21 J g^-1 / temperature K
}

!symbol titanium Ti
titanium {
    molar_mass      mass 47.867 g / amount mol
    specific_heat   specific_energy 0.54 J g^-1 / temperature K
}

!symbol tungsten W
tungsten {
    molar_mass      mass 183.84 g / amount mol
    specific_heat   specific_energy 0.13 J g^-1 / temperature K
}

ununoctium {
    molar_mass      mass 294.21392 g / amount mol
}

ununpentium {
    molar_mass      mass 288.19274 g / amount mol
}

ununseptium {
    molar_mass      mass 292.20746 g / amount mol
}

ununtrium {
    molar_mass      mass 284.17873 g / amount mol
}

!symbol uranium U
uranium {
    molar_mass      mass 238.0289 g / amount mol
    specific_heat   specific_energy 0.12 J g^-1 / temperature K
    molar_mass_235  mass_235 235.0439299 g / amount_235 mol

    ?? Total energy from uranium fission.  Actual efficiency of
    ?? nuclear power plants is around 30%-40%.  Note also that some
    ?? reactors use enriched uranium around 3% U-235.  Uranium during
    ?? processing or use may be in a compound of uranium oxide or
    ?? uranium hexafluoride, in which case the energy density would be
    ?? lower depending on how much uranium is in the compound.
    specific_energy_235_fission fission_energy 200 MeV / mass ((235.0439299 g/mol) / avogadro)
}

!symbol vanadium V
vanadium {
    molar_mass      mass 50.9415 g / amount mol
    specific_heat   specific_energy 0.39 J g^-1 / temperature K
}

!symbol xenon Xe
xenon {
    molar_mass      mass 131.29 g / amount mol
}

!symbol ytterbium Yb
ytterbium {
    molar_mass      mass 173.04 g / amount mol
}

!symbol yttrium Y
yttrium {
    molar_mass      mass 88.90585 g / amount mol
    specific_heat   specific_energy 0.30 J g^-1 / temperature K
}

!symbol zinc Zn
zinc {
    molar_mass      mass 65.39 g / amount mol
    specific_heat   specific_energy 0.39 J g^-1 / temperature K
}

!symbol zirconium Zr
zirconium {
    molar_mass      mass 91.224 g / amount mol
    specific_heat   specific_energy 0.27 J g^-1 / temperature K
}

# The atmospheric composition listed is from NASA Earth Fact Sheet (accessed
# 28 August 2015)
# http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
# Numbers do not add up to exactly 100% due to roundoff and uncertainty Water
# is highly variable, typically makes up about 1%

?? Average molecular weight of air.
air               78.08   % nitrogen 2 \
              +   20.95   % oxygen 2 \
              + 9340    ppm argon \
              +  400    ppm (carbon + oxygen 2) \
              +   18.18 ppm neon \
              +    5.24 ppm helium \
              +    1.7  ppm (carbon + 4 hydrogen) \
              +    1.14 ppm krypton \
              +    0.55 ppm hydrogen 2

# Various abbreviations used in organic chemistry.

!symbol methyl Me
methyl {
    molar_mass      mass 15.03482 g / amount mol
}

!symbol ethyl Et
ethyl {
    molar_mass      mass 29.0617 g / amount mol
}

!symbol acetyl Ac
acetyl {
    molar_mass      mass 43.04522 g / amount mol
}

!symbol phenyl Ph
phenyl {
    molar_mass      mass 77.1057 g / amount mol
}

!endcategory

############################################################################
#
# Unit list aliases
#
# These provide a shorthand for conversions to unit lists.
#
############################################################################

!unitlist hms hr;min;sec
!unitlist time year;day;hr;min;sec
!unitlist dms deg;arcmin;arcsec
!unitlist ftin ft;in;1|8 in
!unitlist inchfine in;1|8 in;1|16 in;1|32 in;1|64 in
!unitlist usvol cup;3|4 cup;2|3 cup;1|2 cup;1|3 cup;1|4 cup;\
                tbsp;tsp;1|2 tsp;1|4 tsp;1|8 tsp

############################################################################
#
# The following units were in the unix units database but do not appear in
# this file:
#
#      wey        used for cheese, salt and other goods.  Measured mass or
#      waymass    volume depending on what was measured and where the measuring
#                 took place.  A wey of cheese ranged from 200 to 324 pounds.
#
#      sack       No precise definition
#
#      spindle    The length depends on the type of yarn
#
#      block      Defined variously on different computer systems
#
#      erlang     A unit of telephone traffic defined variously.
#                 Omitted because there are no other units for this
#                 dimension.  Is this true?  What about CCS = 1/36 erlang?
#                 Erlang is supposed to be dimensionless.  One erlang means
#                 a single channel occupied for one hour.
#
############################################################################