units.lib revision 1.27
1/ $NetBSD: units.lib,v 1.27 2022/10/24 04:55:19 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 293british 1200|3937 m/ft 294 295/ nautical 296/ Historically, the nautical mile was 6080 feet (6080.2 in England) 297/ but was changed to 1852 meters (6076 feet and change) in the 20th 298/ century with varying dates of adoption around the world. 299/ https://en.wikipedia.org/wiki/Nautical_mile 300fathom 6 ft 301nmile 1852 m 302nauticalmile nmile 303marineleague 3 nmile 304cable 720 ft 305 306/ surveying 307rod 5.5 yd 308rd rod 309perch rd 310pole rd 311chain 66 ft 312link 66|100 ft 313furlong 220 yd 314surveyfoot british-ft 315surveyyard 3 surveyfoot 316surveyorschain 66 ft 317surveyorslink 66|100 ft 318 319/ typographical 320pica 1|6 in 321point 1|72 in 322 323/ data centers and machine rooms 324rackunit 1.75 in 325RU rackunit 326U rackunit 327 328/ physics 329bohrradius hbar2-C2/8.988e9 N m2-e2-electronmass 330 331/ miscellaneous/historical/obscure English units 332line 1|12 in 333barleycorn 1|3 in 334finger 7|8 in 335nail 1|16 yd 336palm 3 in 337hand 4 in 338quarter 9 in 339span 9 in 340cubit 18 in 341militarypace 2.5 feet 342pace 36 in 343ell 45 in 344smoot 67 in 345rope 20 ft 346bolt 40 yd 347skein 120 yd 348spindle 14400 yd 349 350/ more ells 351flemishell 27 inch 352scottishell 37.2 inch 353englishell 45 inch 354 355/ I can't find supporting evidence for this definition. 356rood 1.21e+3 yd 357 358/ other 359geodeticfoot british-ft 360geographicalmile 1852 m 361engineerschain 100 ft 362engineerslink 100|100 ft 363gunterschain 22 yd 364 365/ note that while caliber is technically a unit, caliber sizes for ammunition 366/ are usually short names for more complicated specifications. 367caliber 1e-2 in 368 369frenchfoot 16|15 ft 370frenchfeet frenchfoot 371toise 6 frenchfeet 372 373parasang 3.5 mi 374 375/ Thai length 376 377krabiat 0.5208 cm 378nio 4 krabiat 379khuep 12 nio 380sok 2 khuep 381wah 4 sok 382sen 20 wah 383yot 400 sen 384 385/ //////////////////////////////////////////////////////////// 386/ Speed 387 388admiraltyknot 6080 ft/hr 389knot nmile/hr 390mph mile/hr 391 392/ The speed of sound varies substantially with density, and thus 393/ both pressure and temperature. This number appears to be for 394/ 0 degrees Celsius at sea level. The value is considerably lower 395/ at typical flight altitudes for high-performance aircraft. 396mach 331.46 m/sec 397 398/ //////////////////////////////////////////////////////////// 399/ Area 400 401/ metric 402are 1e+2 m2 403hectare 1e+4 m2 404 405/ English 406sabin 1 ft2 407square 100 ft2 408acre 4840 yd2 409homestead 1|4 mi2 410quartersection 1|4 mi2 411section mi2 412township 36 mi2 413 414/ particle physics 415barn 1e-28 m2 416shed 1e-24 barn 417 418/ Thai area 419tarangwah wah2 420ngan 100 tarangwah 421rai 4 ngan 422 423/ //////////////////////////////////////////////////////////// 424/ Volume 425 426/ metric 427cc cm3 428liter kilocc 429litre liter 430ml milliliter 431stere m3 432 433/ US liquid volume 434 435gallon 231 in3 436gal gallon 437quart 1|4 gal 438qt quart 439pint 1|2 qt 440pt pint 441cup 1|2 pt 442gill 1|4 pt 443floz 1|16 pt 444tablespoon 1|2 floz 445teaspoon 1|3 tablespoon 446fldr 1|8 floz 447minim 1|60 fldr 448 449barrel 42 gal 450hogshead 63 gallon 451hd hogshead 452 453noggin 1|8 qt 454fifth 4|5 qt 455firkin 9 gal 456kilderkin 18 gal 457pipe 4 barrel 458tun 8 barrel 459 460/ US dry volume 461 462dry 268.8025 in3/gallon fuzz 463 464peck 8 dry-quart 465pk peck 466bushel 4 peck 467bu bushel 468strike 2 bu 469sack 3 bu 470coomb 4 bu 471seam 8 bu 472chaldron 36 bushel 473wey 40 bu 474last 80 bu 475 476cord 128 ft3 477cordfoot cord 478 479/ British volume 480 481imperial 1.20095 482 483brgallon 277.420 in3 fuzz 484brquart 1|4 brgallon 485brpint 1|2 brquart 486brfloz 1|20 brpint 487brpeck 554.84 in3 fuzz 488brbushel 4 brpeck 489cran 37.5 brgallon 490 491/ Bottles 492 493bottle 750 milliliter 494/bottle fifth 495 496miniature 100 milliliter 497split 1|4 bottle 498half 1|2 bottle 499magnum 2 bottle 500jeroboam 4 bottle 501rehoboam 6 bottle 502methuselah 8 bottle 503salmanazar 12 bottle 504balthazar 16 bottle 505nebuchadnezzar 20 bottle 506sovereign 34 bottle 507 508/ Bottles - alternate names and spellings 509 510pony split 511fillette half 512tappithen 3 bottle 513rheoboam rehoboam 514shalmaneser salmanazar 515 516/ //////////////////////////////////////////////////////////// 517/ Force 518 519/ SI unit 520newton kg-m/sec2 521nt newton 522N newton 523 524/ metric units 525dyne cm-gm/sec2 526sthene 1e+3 nt 527 528/ foot/pound units 529lbf lb g 530kip 1000 lbf 531poundal ft-lb/sec2 532pdl poundal 533 534/ //////////////////////////////////////////////////////////// 535/ Pressure 536 537/ SI unit 538pascal nt/m2 539 540/ metric units 541bar 1e+5 nt/m2 542barie 1e-1 nt/m2 543barye 1e-1 nt/m2 544pieze 1e+3 nt/m2 545 546/ other 547atmosphere 1.01325e+5 nt/m2 548atm atmosphere 549psi lb-g/in2 550torr mm hg 551 552/ //////////////////////////////////////////////////////////// 553/ Energy and work (and power) 554 555joule nt-m 556watt joule/sec 557W watt 558 559cal 4.1868 joule 560calorie cal 561kcal kilocal 562kcalorie kilocal 563frigorie kilocal 564 565britishthermalunit 1.05506e+3 joule fuzz 566btu britishthermalunit 567erg cm2-gm/sec2 568horsepower 550 ft-lb-g/sec 569hp horsepower 570therm 1e+5 btu 571thermie 1e+6 cal 572tnt 4.6e+6 m2/sec2 573 574/ //////////////////////////////////////////////////////////// 575/ Temperature 576 577degC K 578kelvin K 579degF 5|9 degC 580degreesrankine degF 581degrankine degreesrankine 582degreerankine degF 583degreaumur 10|8 degC 584 585/ //////////////////////////////////////////////////////////// 586/ Electrical 587 588/ SI units 589coulomb coul 590C coul 591ampere coul/sec 592amp ampere 593V volt 594volt watt/amp 595ohm volt/amp 596farad coul/volt 597henry sec2/farad 598weber volt-sec 599tesla weber/m2 600 601/ special-case abbreviations 602mh millihenry 603pf picofarad 604 605/ other 606biot 10 amp 607debye 3.336e-30 coul-m 608faraday 9.652e+4 coul 609franklin 3.33564e-10 coul 610gamma 1e-9 weber/m2 611gauss 1e-4 weber/m2 612gilbert 7.95775e-1 amp 613kilohm kiloohm 614maxwell 1e-8 weber 615megohm megaohm 616mho /ohm 617oersted 2.5e+2 pi-amp/m 618oe oersted 619siemens /ohm 620statcoul 1|2.99792458e9 coul 621statamp 1|2.99792458e9 amp 622statvolt 2.99792458e2 volt 623statcoulomb statcoul 624statampere statamp 625 626/ //////////////////////////////////////////////////////////// 627/ more energy 628 629eV e V 630ev e-volt 631electronvolt e-volt 632bev 1e+9 e-volt 633kev 1e+3 e-volt 634 635rydberg 1.36054e+1 ev 636 637/ //////////////////////////////////////////////////////////// 638/ Radiant intensity (and related phenomena) 639 640/ SI units 641cd candela 642lumen cd sr 643lux cd sr/m2 644 645/ Miscellaneous units 646apostilb cd/pi-m2 647blondel cd/pi-m2 648candle 1.02 candela 649equivalentfootcandle lumen/pi-ft2 650equivalentlux lumen/pi-m2 651equivalentphot cd/pi-cm2 652footcandle lumen/ft2 653footlambert cd/pi-ft2 654hefnercandle .92 cd 655lambert cd/pi-cm2 656nit cd/m2 657nox 1e-3 lux 658phot lumen/cm2 659skot 1e-3 apostilb 660stilb cd/cm2 661 662langley cal/cm2 663 664/ //////////////////////////////////////////////////////////// 665/ Radioactivity and radiation dosimetry 666 667/ Activity 668 669becquerel /sec 670Bq becquerel 671curie 3.7e+10 /sec 672Ci curie 673rutherford 1e+6 /sec 674 675/ Absorbed radiation dose 676 677gray joule/kg 678Gy gray 679rad 100 erg/gm 680 681/ Equivalent radiation dose 682 683sievert joule/kg 684Sv sievert 685rem 1e-2 sievert 686 687/ Legacy radiation dose 688 689roentgen 2.58e-4 coulomb/kg 690rontgen roentgen 691R roentgen 692 693/ //////////////////////////////////////////////////////////// 694/ Currency 695 696/ Wall Street Journal, July 2, 1993 697 698$ dollar 699argentinapeso $ 700australiadollar .66 $ 701bahraindinar 2.6522 $ 702brazilcruzeiro .000019 $ 703britainpound 1.49 $ 704canadadollar .77 $ 705czechkoruna .034 $ 706chilepeso .0025 $ 707chinarenminbi .174856 $ 708colombiapeso .001495 $ 709denmarkkrone .15 $ 710ecuadorsucre .000539 $ 711europeeuro 0.9142 $ 712greatbritainpound britainpound 713hongkongdollar .13 $ 714hungaryforint .011 $ 715indiarupee .03211 $ 716indonesiarupiah .0004782 $ 717israelshekel .3642 $ 718japanyen .0093 $ 719jordandinar 1.4682 $ 720kuwaitdinar 3.3173 $ 721lebanonpound .000578 $ 722malaysiaringgit .338 $ 723maltalira 2.6042 $ 724mexicopeso .3205128 $ 725newzealanddollar .539 $ 726norwaykrone .139 $ 727pakistanrupee .037 $ 728perunewsol .5065 $ 729philippinespeso .03738 $ 730polandzloty .000059 $ 731saudiarabiariyal .26702 $ 732singaporedollar .6157 $ 733slovakkoruna .034 $ 734southafricarand .21 $ 735southkoreawon .001 $ 736swedenkrona .13 $ 737switzerlandfranc .66 $ 738taiwandollar .038285 $ 739thailandbaht .03962 $ 740turkeylira .0000929 $ 741unitedarabdirham .2723 $ 742uruguaynewpeso .246852 $ 743venezuelabolivar .011 $ 744 745/ The following currencies are locked to the Euro: 746/ <URL:http://www.ecb.int/change/conversion.htm> 747belgiumfranc 1|40.3399 euro 748germanymark 1|1.95583 euro 749spainpeseta 1|166.386 euro 750francefranc 1|6.55957 euro 751irelandpunt 1|.787564 euro 752italylira 1|1936.27 euro 753luxembourgfranc 1|40.3399 euro 754netherlandsguilder 1|2.20371 euro 755austriaschilling 1|13.7603 euro 756portugalescudo 1|200.482 euro 757finlandmarkka 1|5.94573 euro 758greecedrachma 1|340.750 euro 759 760mark germanymark 761euro europeeuro 762bolivar venezuelabolivar 763peseta spainpeseta 764rand southafricarand 765escudo portugalescudo 766newsol perunewsol 767guilder netherlandsguilder 768hollandguilder netherlandsguilder 769peso mexicopeso 770yen japanyen 771lira italylira 772rupee indiarupee 773drachma greecedrachma 774franc francefranc 775markka finlandmarkka 776sucre ecuadorsucre 777poundsterling britainpound 778cruzeiro brazilcruzeiro 779 780buck dollar 781cent centidollar 782fin 5 dollar 783 784/ //////////////////////////////////////////////////////////// 785/ size of data 786 787baud bit/sec 788byte 8 bit 789block 512 byte 790kbyte 1024 byte 791megabyte 1024 kbyte 792gigabyte 1024 megabyte 793meg megabyte 794terabyte 1024 gigabyte 795petabyte 1024 terabyte 796 797 798/ //////////////////////////////////////////////////////////// 799/ Trivia and miscellaneous units 800 801arpentcan 27.52 mi 802arpentlin 191.835 ft 803boardfoot 144 in3 804bottommeasure 1|40 in 805refrigeration 12000 btu/ton-hour 806caratgold 1|24 807ccs 1|36 erlang 808cfs ft3/sec 809circularinch 1|4 pi-in2 810circularmil 1e-6|4 pi-in2 811clusec 1e-8 mm-hg m3/s 812crith 9.06e-2 gm 813diopter /m 814displacementton 35 ft3 815doppelzentner 100 kg 816drop .03 cm3 817galileo 1e-2 m/sec2 818imaginarycubicfoot 1.4 ft3 819karat 1|24 820key kg 821lusec 1e-6 mm-hg m3/s 822mgd megagal/day 823minersinch 1.5 ft3/min 824mpg mile/gal 825poise gm/cm-sec 826registerton 100 ft3 827rhe 10 m2/nt-sec 828shippington 40 ft3 829stoke 1e-4 m2/sec 830timberfoot ft3 831water gram g / cc 832Xunit 1.00202e-13 m 833 834brewster 1e-12 m2/newton 835poncelet 100 kg m g / sec 836denier .05|450 gram / m 837tex .001 gram / m 838iudiptheria 62.8 microgram 839iupenicillin .6 microgram 840iuinsulin 41.67 microgram 841cottonyarncount 2520 ft/pound 842linenyarncount 900 ft/pound 843worstedyarncount 1680 ft/pound 844metricyarncount meter/gram 845jewlerspoint 2 milligram 846 847