units.lib revision 1.28
1/ $NetBSD: units.lib,v 1.28 2022/10/24 05:04:50 dholland Exp $ 2 3/ primitive units 4 5m !a! 6kg !b! 7sec !c! 8coul !d! 9candela !e! 10dollar !f! 11bit !h! 12erlang !i! 13K !j! 14 15/ prefixes 16 17yotta- 1e24 18zetta- 1e21 19exa- 1e18 20peta- 1e15 21tera- 1e12 22giga- 1e9 23mega- 1e6 24myria- 1e4 25kilo- 1e3 26hecto- 1e2 27deka- 1e1 28deci- 1e-1 29centi- 1e-2 30milli- 1e-3 31micro- 1e-6 32nano- 1e-9 33pico- 1e-12 34femto- 1e-15 35atto- 1e-18 36zopto- 1e-21 37yocto- 1e-24 38 39semi- .5 40demi- .5 41 42Y- yotta 43Z- zetta 44E- exa 45P- peta 46T- tera 47G- giga 48M- mega 49k- kilo 50h- hecto 51da- deka 52d- deci 53c- centi 54m- milli 55p- pico 56f- femto 57a- atto 58z- zopto 59y- yocto 60 61/ //////////////////////////////////////////////////////////// 62/ constants 63 64fuzz 1 65 66pi 3.14159265358979323846 67c 2.99792458e+8 m/sec fuzz 68e 1.6021917e-19 coul fuzz 69k 1.38047e-16 erg/degC 70planck 6.626e-34 joule-sec 71hbar 1.055e-34 joule-sec 72mole 6.022169e+23 fuzz 73 74g 9.80665 m/sec2 75 76/ conversion factors used as adjectives 77energy c2 78force g 79mercury 1.33322e+5 kg/m2-sec2 80hg mercury 81 82/ standard ratios 83% 1|100 84percent % 85/ proof is specific to alcohol concentration 86proof 1|200 87 88/ //////////////////////////////////////////////////////////// 89/ counts 90 91dozen 12 92bakersdozen 13 93score 20 94gross 144 95 96/ quire and ream are specific to counting sheets of paper 97quire 25 98ream 500 99 100/ //////////////////////////////////////////////////////////// 101/ angles 102 103radian .5 / pi 104degree 1|180 pi-radian 105circle 2 pi-radian 106turn 2 pi-radian 107revolution turn 108rev turn 109grade .9 degree 110arcdeg 1 degree 111arcmin 1|60 arcdeg 112arcsec 1|60 arcmin 113 114centesimalminute 1e-2 grade 115centesimalsecond 1e-4 grade 116 117/ //////////////////////////////////////////////////////////// 118/ solid angles 119 120steradian radian2 121sphere 4 pi-steradian 122sr steradian 123spat 4 pi sr 124 125/ //////////////////////////////////////////////////////////// 126/ Time 127 128/ SI unit 129second sec 130s sec 131 132/ special-case abbreviations 133ms millisec 134ns nanosec 135us microsec 136 137/ civil timekeeping 138minute 60 sec 139min minute 140hour 60 min 141hr hour 142day 24 hr 143da day 144week 7 day 145fortnight 14 da 146month 1|12 year 147mo month 148year 365.24219879 day fuzz 149yr year 150decade 10 yr 151century 100 year 152millennium 1000 year 153 154/ astronomical details 155siderealyear 365.256360417 day 156siderealday 23.934469444 hour 157siderealhour 1|24 siderealday 158lunarmonth 29.5305555 day 159synodicmonth lunarmonth 160siderealmonth 27.32152777 day 161tropicalyear year 162solaryear year 163lunaryear 12 lunarmonth 164 165/ misc 166sigma microsec 167 168/ //////////////////////////////////////////////////////////// 169/ Frequency 170 171hertz /sec 172Hz hertz 173hz /sec 174khz 1e+3 /sec 175mhz 1e+6 /sec 176rpm rev/minute 177rps rev/sec 178 179fresnel 1e12 hertz 180pulsatance 2 pi/sec 181 182/ //////////////////////////////////////////////////////////// 183/ Mass and weight 184 185gram millikg 186gramme gram 187gm gram 188mg milligram 189metricton kilokg 190tonne 1e+6 gm 191 192atomicmassunit 1.66044e-27 kg fuzz 193amu atomicmassunit 194dalton amu 195 196electronmass 9.1095e-31 kg 197protonmass 1.6726e-27 kg 198neutronmass 1.6606e-27 kg 199 200carat 205 mg 201metriccarat 200 mg 202quintal 100 kg 203 204/ Avoirdupois weight 205 206lb .45359237 kg 207pound lb 208ounce 1|16 lb 209oz ounce 210dram 1|16 oz 211dr dram 212grain 1|7000 lb 213gr grain 214stone 14 lb 215shortton 2000 lb 216ton shortton 217longton 2240 lb 218 219bag 94 lb 220cental 100 lb 221longhundredweight 112 lb 222longquarter 28 lb 223pennyweight 1|20 oz 224pwt pennyweight 225shorthundredweight 100 lb 226shortquarter 25 lb 227weymass 252 lb 228 229/ Related mass units 230/ 231/ According to Wikipedia there are two definitions for hyl, one using 232/ grams and one using kilograms. beware 233 234hyl gm force sec2/m 235slug lb-g-sec2/ft 236 237/ Apothecary weight 238 239scruple 20 grain 240apdram 60 grain 241drachm 60 grain 242apounce 480 grain 243appound 5760 grain 244troypound appound 245troyounce 1|12 troypound 246 247/ Thai weight 248 249salueng 3.75 gm 250baht 4 salueng 251tamlueng 4 baht 252chang 20 tamlueng 253hap 50 chang 254 255/ //////////////////////////////////////////////////////////// 256/ Length 257 258/ SI unit 259meter m 260metre meter 261 262/ special-case abbreviations 263cm centimeter 264mm millimeter 265km kilometer 266nm nanometer 267 268/ other metric units 269angstrom decinanometer 270fermi 1e-15 m 271micron micrometer 272 273/ space-sized lengths 274au 1.49597871e+11 m fuzz 275astronomicalunit au 276lightyear c-yr 277parsec au-radian/arcsec 278pc parsec 279 280/ English system lengths 281inch 2.54 cm 282in inch 283foot 12 in 284feet foot 285ft foot 286yard 3 ft 287yd yard 288mile 5280 ft 289mi mile 290league 3 mi 291mil 1e-3 in 292 293/ nautical 294/ Historically, the nautical mile was 6080 feet (6080.2 in England) 295/ but was changed to 1852 meters (6076 feet and change) in the 20th 296/ century with varying dates of adoption around the world. 297/ https://en.wikipedia.org/wiki/Nautical_mile 298fathom 6 ft 299nmile 1852 m 300nauticalmile nmile 301marineleague 3 nmile 302cable 720 ft 303 304/ surveying 305/ 306/ The US survey foot is defined as 1200/3937 meters, as opposed to the 307/ ordinary international foot, which is 0.3048 meter (that's exactly 308/ 2.54 cm to the inch as defined above.) 309/ https://en.wikipedia.org/wiki/Foot_(unit) 310rod 5.5 yd 311rd rod 312perch rd 313pole rd 314chain 66 ft 315link 66|100 ft 316furlong 220 yd 317surveyfoot 1200|3937 meter 318surveyyard 3 surveyfoot 319surveyorschain 66 ft 320surveyorslink 66|100 ft 321 322/ typographical 323pica 1|6 in 324point 1|72 in 325 326/ data centers and machine rooms 327rackunit 1.75 in 328RU rackunit 329U rackunit 330 331/ physics 332bohrradius hbar2-C2/8.988e9 N m2-e2-electronmass 333 334/ miscellaneous/historical/obscure English units 335line 1|12 in 336barleycorn 1|3 in 337finger 7|8 in 338nail 1|16 yd 339palm 3 in 340hand 4 in 341quarter 9 in 342span 9 in 343cubit 18 in 344militarypace 2.5 feet 345pace 36 in 346ell 45 in 347smoot 67 in 348rope 20 ft 349bolt 40 yd 350skein 120 yd 351spindle 14400 yd 352 353/ more ells 354flemishell 27 inch 355scottishell 37.2 inch 356englishell 45 inch 357 358/ I can't find supporting evidence for this definition. 359rood 1.21e+3 yd 360 361/ other 362geodeticfoot surveyfoot 363geographicalmile 1852 m 364engineerschain 100 ft 365engineerslink 100|100 ft 366gunterschain 22 yd 367 368/ note that while caliber is technically a unit, caliber sizes for ammunition 369/ are usually short names for more complicated specifications. 370caliber 1e-2 in 371 372frenchfoot 16|15 ft 373frenchfeet frenchfoot 374toise 6 frenchfeet 375 376parasang 3.5 mi 377 378/ Thai length 379 380krabiat 0.5208 cm 381nio 4 krabiat 382khuep 12 nio 383sok 2 khuep 384wah 4 sok 385sen 20 wah 386yot 400 sen 387 388/ //////////////////////////////////////////////////////////// 389/ Speed 390 391admiraltyknot 6080 ft/hr 392knot nmile/hr 393mph mile/hr 394 395/ The speed of sound varies substantially with density, and thus 396/ both pressure and temperature. This number appears to be for 397/ 0 degrees Celsius at sea level. The value is considerably lower 398/ at typical flight altitudes for high-performance aircraft. 399mach 331.46 m/sec 400 401/ //////////////////////////////////////////////////////////// 402/ Area 403 404/ metric 405are 1e+2 m2 406hectare 1e+4 m2 407 408/ English 409sabin 1 ft2 410square 100 ft2 411acre 4840 yd2 412homestead 1|4 mi2 413quartersection 1|4 mi2 414section mi2 415township 36 mi2 416 417/ particle physics 418barn 1e-28 m2 419shed 1e-24 barn 420 421/ Thai area 422tarangwah wah2 423ngan 100 tarangwah 424rai 4 ngan 425 426/ //////////////////////////////////////////////////////////// 427/ Volume 428 429/ metric 430cc cm3 431liter kilocc 432litre liter 433ml milliliter 434stere m3 435 436/ US liquid volume 437 438gallon 231 in3 439gal gallon 440quart 1|4 gal 441qt quart 442pint 1|2 qt 443pt pint 444cup 1|2 pt 445gill 1|4 pt 446floz 1|16 pt 447tablespoon 1|2 floz 448teaspoon 1|3 tablespoon 449fldr 1|8 floz 450minim 1|60 fldr 451 452barrel 42 gal 453hogshead 63 gallon 454hd hogshead 455 456noggin 1|8 qt 457fifth 4|5 qt 458firkin 9 gal 459kilderkin 18 gal 460pipe 4 barrel 461tun 8 barrel 462 463/ US dry volume 464 465dry 268.8025 in3/gallon fuzz 466 467peck 8 dry-quart 468pk peck 469bushel 4 peck 470bu bushel 471strike 2 bu 472sack 3 bu 473coomb 4 bu 474seam 8 bu 475chaldron 36 bushel 476wey 40 bu 477last 80 bu 478 479cord 128 ft3 480cordfoot cord 481 482/ British volume 483 484imperial 1.20095 485 486brgallon 277.420 in3 fuzz 487brquart 1|4 brgallon 488brpint 1|2 brquart 489brfloz 1|20 brpint 490brpeck 554.84 in3 fuzz 491brbushel 4 brpeck 492cran 37.5 brgallon 493 494/ Bottles 495 496bottle 750 milliliter 497/bottle fifth 498 499miniature 100 milliliter 500split 1|4 bottle 501half 1|2 bottle 502magnum 2 bottle 503jeroboam 4 bottle 504rehoboam 6 bottle 505methuselah 8 bottle 506salmanazar 12 bottle 507balthazar 16 bottle 508nebuchadnezzar 20 bottle 509sovereign 34 bottle 510 511/ Bottles - alternate names and spellings 512 513pony split 514fillette half 515tappithen 3 bottle 516rheoboam rehoboam 517shalmaneser salmanazar 518 519/ //////////////////////////////////////////////////////////// 520/ Force 521 522/ SI unit 523newton kg-m/sec2 524nt newton 525N newton 526 527/ metric units 528dyne cm-gm/sec2 529sthene 1e+3 nt 530 531/ foot/pound units 532lbf lb g 533kip 1000 lbf 534poundal ft-lb/sec2 535pdl poundal 536 537/ //////////////////////////////////////////////////////////// 538/ Pressure 539 540/ SI unit 541pascal nt/m2 542 543/ metric units 544bar 1e+5 nt/m2 545barie 1e-1 nt/m2 546barye 1e-1 nt/m2 547pieze 1e+3 nt/m2 548 549/ other 550atmosphere 1.01325e+5 nt/m2 551atm atmosphere 552psi lb-g/in2 553torr mm hg 554 555/ //////////////////////////////////////////////////////////// 556/ Energy and work (and power) 557 558joule nt-m 559watt joule/sec 560W watt 561 562cal 4.1868 joule 563calorie cal 564kcal kilocal 565kcalorie kilocal 566frigorie kilocal 567 568britishthermalunit 1.05506e+3 joule fuzz 569btu britishthermalunit 570erg cm2-gm/sec2 571horsepower 550 ft-lb-g/sec 572hp horsepower 573therm 1e+5 btu 574thermie 1e+6 cal 575tnt 4.6e+6 m2/sec2 576 577/ //////////////////////////////////////////////////////////// 578/ Temperature 579 580degC K 581kelvin K 582degF 5|9 degC 583degreesrankine degF 584degrankine degreesrankine 585degreerankine degF 586degreaumur 10|8 degC 587 588/ //////////////////////////////////////////////////////////// 589/ Electrical 590 591/ SI units 592coulomb coul 593C coul 594ampere coul/sec 595amp ampere 596V volt 597volt watt/amp 598ohm volt/amp 599farad coul/volt 600henry sec2/farad 601weber volt-sec 602tesla weber/m2 603 604/ special-case abbreviations 605mh millihenry 606pf picofarad 607 608/ other 609biot 10 amp 610debye 3.336e-30 coul-m 611faraday 9.652e+4 coul 612franklin 3.33564e-10 coul 613gamma 1e-9 weber/m2 614gauss 1e-4 weber/m2 615gilbert 7.95775e-1 amp 616kilohm kiloohm 617maxwell 1e-8 weber 618megohm megaohm 619mho /ohm 620oersted 2.5e+2 pi-amp/m 621oe oersted 622siemens /ohm 623statcoul 1|2.99792458e9 coul 624statamp 1|2.99792458e9 amp 625statvolt 2.99792458e2 volt 626statcoulomb statcoul 627statampere statamp 628 629/ //////////////////////////////////////////////////////////// 630/ more energy 631 632eV e V 633ev e-volt 634electronvolt e-volt 635bev 1e+9 e-volt 636kev 1e+3 e-volt 637 638rydberg 1.36054e+1 ev 639 640/ //////////////////////////////////////////////////////////// 641/ Radiant intensity (and related phenomena) 642 643/ SI units 644cd candela 645lumen cd sr 646lux cd sr/m2 647 648/ Miscellaneous units 649apostilb cd/pi-m2 650blondel cd/pi-m2 651candle 1.02 candela 652equivalentfootcandle lumen/pi-ft2 653equivalentlux lumen/pi-m2 654equivalentphot cd/pi-cm2 655footcandle lumen/ft2 656footlambert cd/pi-ft2 657hefnercandle .92 cd 658lambert cd/pi-cm2 659nit cd/m2 660nox 1e-3 lux 661phot lumen/cm2 662skot 1e-3 apostilb 663stilb cd/cm2 664 665langley cal/cm2 666 667/ //////////////////////////////////////////////////////////// 668/ Radioactivity and radiation dosimetry 669 670/ Activity 671 672becquerel /sec 673Bq becquerel 674curie 3.7e+10 /sec 675Ci curie 676rutherford 1e+6 /sec 677 678/ Absorbed radiation dose 679 680gray joule/kg 681Gy gray 682rad 100 erg/gm 683 684/ Equivalent radiation dose 685 686sievert joule/kg 687Sv sievert 688rem 1e-2 sievert 689 690/ Legacy radiation dose 691 692roentgen 2.58e-4 coulomb/kg 693rontgen roentgen 694R roentgen 695 696/ //////////////////////////////////////////////////////////// 697/ Currency 698 699/ Wall Street Journal, July 2, 1993 700 701$ dollar 702argentinapeso $ 703australiadollar .66 $ 704bahraindinar 2.6522 $ 705brazilcruzeiro .000019 $ 706britainpound 1.49 $ 707canadadollar .77 $ 708czechkoruna .034 $ 709chilepeso .0025 $ 710chinarenminbi .174856 $ 711colombiapeso .001495 $ 712denmarkkrone .15 $ 713ecuadorsucre .000539 $ 714europeeuro 0.9142 $ 715greatbritainpound britainpound 716hongkongdollar .13 $ 717hungaryforint .011 $ 718indiarupee .03211 $ 719indonesiarupiah .0004782 $ 720israelshekel .3642 $ 721japanyen .0093 $ 722jordandinar 1.4682 $ 723kuwaitdinar 3.3173 $ 724lebanonpound .000578 $ 725malaysiaringgit .338 $ 726maltalira 2.6042 $ 727mexicopeso .3205128 $ 728newzealanddollar .539 $ 729norwaykrone .139 $ 730pakistanrupee .037 $ 731perunewsol .5065 $ 732philippinespeso .03738 $ 733polandzloty .000059 $ 734saudiarabiariyal .26702 $ 735singaporedollar .6157 $ 736slovakkoruna .034 $ 737southafricarand .21 $ 738southkoreawon .001 $ 739swedenkrona .13 $ 740switzerlandfranc .66 $ 741taiwandollar .038285 $ 742thailandbaht .03962 $ 743turkeylira .0000929 $ 744unitedarabdirham .2723 $ 745uruguaynewpeso .246852 $ 746venezuelabolivar .011 $ 747 748/ The following currencies are locked to the Euro: 749/ <URL:http://www.ecb.int/change/conversion.htm> 750belgiumfranc 1|40.3399 euro 751germanymark 1|1.95583 euro 752spainpeseta 1|166.386 euro 753francefranc 1|6.55957 euro 754irelandpunt 1|.787564 euro 755italylira 1|1936.27 euro 756luxembourgfranc 1|40.3399 euro 757netherlandsguilder 1|2.20371 euro 758austriaschilling 1|13.7603 euro 759portugalescudo 1|200.482 euro 760finlandmarkka 1|5.94573 euro 761greecedrachma 1|340.750 euro 762 763mark germanymark 764euro europeeuro 765bolivar venezuelabolivar 766peseta spainpeseta 767rand southafricarand 768escudo portugalescudo 769newsol perunewsol 770guilder netherlandsguilder 771hollandguilder netherlandsguilder 772peso mexicopeso 773yen japanyen 774lira italylira 775rupee indiarupee 776drachma greecedrachma 777franc francefranc 778markka finlandmarkka 779sucre ecuadorsucre 780poundsterling britainpound 781cruzeiro brazilcruzeiro 782 783buck dollar 784cent centidollar 785fin 5 dollar 786 787/ //////////////////////////////////////////////////////////// 788/ size of data 789 790baud bit/sec 791byte 8 bit 792block 512 byte 793kbyte 1024 byte 794megabyte 1024 kbyte 795gigabyte 1024 megabyte 796meg megabyte 797terabyte 1024 gigabyte 798petabyte 1024 terabyte 799 800 801/ //////////////////////////////////////////////////////////// 802/ Trivia and miscellaneous units 803 804arpentcan 27.52 mi 805arpentlin 191.835 ft 806boardfoot 144 in3 807bottommeasure 1|40 in 808refrigeration 12000 btu/ton-hour 809caratgold 1|24 810ccs 1|36 erlang 811cfs ft3/sec 812circularinch 1|4 pi-in2 813circularmil 1e-6|4 pi-in2 814clusec 1e-8 mm-hg m3/s 815crith 9.06e-2 gm 816diopter /m 817displacementton 35 ft3 818doppelzentner 100 kg 819drop .03 cm3 820galileo 1e-2 m/sec2 821imaginarycubicfoot 1.4 ft3 822karat 1|24 823key kg 824lusec 1e-6 mm-hg m3/s 825mgd megagal/day 826minersinch 1.5 ft3/min 827mpg mile/gal 828poise gm/cm-sec 829registerton 100 ft3 830rhe 10 m2/nt-sec 831shippington 40 ft3 832stoke 1e-4 m2/sec 833timberfoot ft3 834water gram g / cc 835Xunit 1.00202e-13 m 836 837brewster 1e-12 m2/newton 838poncelet 100 kg m g / sec 839denier .05|450 gram / m 840tex .001 gram / m 841iudiptheria 62.8 microgram 842iupenicillin .6 microgram 843iuinsulin 41.67 microgram 844cottonyarncount 2520 ft/pound 845linenyarncount 900 ft/pound 846worstedyarncount 1680 ft/pound 847metricyarncount meter/gram 848jewlerspoint 2 milligram 849 850