Module Name: src Committed By: dholland Date: Mon Oct 24 04:55:19 UTC 2022
Modified Files: src/usr.bin/units: units.lib Log Message: Reorganize units.lib. It's all very well to file miscellaneous old units under "trivia" but it's more useful to sort first by type and then by creakiness. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/units/units.lib Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/units/units.lib diff -u src/usr.bin/units/units.lib:1.26 src/usr.bin/units/units.lib:1.27 --- src/usr.bin/units/units.lib:1.26 Tue Feb 15 16:21:35 2022 +++ src/usr.bin/units/units.lib Mon Oct 24 04:55:19 2022 @@ -1,4 +1,4 @@ -/ $NetBSD: units.lib,v 1.26 2022/02/15 16:21:35 jakllsch Exp $ +/ $NetBSD: units.lib,v 1.27 2022/10/24 04:55:19 dholland Exp $ / primitive units @@ -58,21 +58,47 @@ a- atto z- zopto y- yocto +/ //////////////////////////////////////////////////////////// / constants fuzz 1 + pi 3.14159265358979323846 c 2.99792458e+8 m/sec fuzz -g 9.80665 m/sec2 -au 1.49597871e+11 m fuzz -mole 6.022169e+23 fuzz e 1.6021917e-19 coul fuzz +k 1.38047e-16 erg/degC +planck 6.626e-34 joule-sec +hbar 1.055e-34 joule-sec +mole 6.022169e+23 fuzz + +g 9.80665 m/sec2 + +/ conversion factors used as adjectives energy c2 force g mercury 1.33322e+5 kg/m2-sec2 hg mercury -/ dimensionless +/ standard ratios +% 1|100 +percent % +/ proof is specific to alcohol concentration +proof 1|200 + +/ //////////////////////////////////////////////////////////// +/ counts + +dozen 12 +bakersdozen 13 +score 20 +gross 144 + +/ quire and ream are specific to counting sheets of paper +quire 25 +ream 500 + +/ //////////////////////////////////////////////////////////// +/ angles radian .5 / pi degree 1|180 pi-radian @@ -83,17 +109,32 @@ rev turn grade .9 degree arcdeg 1 degree arcmin 1|60 arcdeg -ccs 1|36 erlang arcsec 1|60 arcmin +centesimalminute 1e-2 grade +centesimalsecond 1e-4 grade + +/ //////////////////////////////////////////////////////////// +/ solid angles + steradian radian2 sphere 4 pi-steradian sr steradian +spat 4 pi sr +/ //////////////////////////////////////////////////////////// / Time +/ SI unit second sec s sec + +/ special-case abbreviations +ms millisec +ns nanosec +us microsec + +/ civil timekeeping minute 60 sec min minute hour 60 min @@ -101,53 +142,142 @@ hr hour day 24 hr da day week 7 day +fortnight 14 da +month 1|12 year +mo month year 365.24219879 day fuzz yr year -month 1|12 year -ms millisec -us microsec +decade 10 yr +century 100 year +millennium 1000 year + +/ astronomical details +siderealyear 365.256360417 day +siderealday 23.934469444 hour +siderealhour 1|24 siderealday +lunarmonth 29.5305555 day +synodicmonth lunarmonth +siderealmonth 27.32152777 day +tropicalyear year +solaryear year +lunaryear 12 lunarmonth + +/ misc +sigma microsec + +/ //////////////////////////////////////////////////////////// +/ Frequency + +hertz /sec +Hz hertz +hz /sec +khz 1e+3 /sec +mhz 1e+6 /sec +rpm rev/minute +rps rev/sec + +fresnel 1e12 hertz +pulsatance 2 pi/sec -/ Mass +/ //////////////////////////////////////////////////////////// +/ Mass and weight gram millikg +gramme gram gm gram mg milligram metricton kilokg +tonne 1e+6 gm + +atomicmassunit 1.66044e-27 kg fuzz +amu atomicmassunit +dalton amu + +electronmass 9.1095e-31 kg +protonmass 1.6726e-27 kg +neutronmass 1.6606e-27 kg + +carat 205 mg +metriccarat 200 mg +quintal 100 kg -/ Avoirdupois +/ Avoirdupois weight lb .45359237 kg pound lb -lbf lb g ounce 1|16 lb oz ounce dram 1|16 oz dr dram grain 1|7000 lb gr grain +stone 14 lb shortton 2000 lb ton shortton longton 2240 lb -/ Apothecary +bag 94 lb +cental 100 lb +longhundredweight 112 lb +longquarter 28 lb +pennyweight 1|20 oz +pwt pennyweight +shorthundredweight 100 lb +shortquarter 25 lb +weymass 252 lb + +/ Related mass units +/ +/ According to Wikipedia there are two definitions for hyl, one using +/ grams and one using kilograms. beware + +hyl gm force sec2/m +slug lb-g-sec2/ft + +/ Apothecary weight scruple 20 grain apdram 60 grain +drachm 60 grain apounce 480 grain appound 5760 grain troypound appound troyounce 1|12 troypound +/ Thai weight + +salueng 3.75 gm +baht 4 salueng +tamlueng 4 baht +chang 20 tamlueng +hap 50 chang + +/ //////////////////////////////////////////////////////////// / Length +/ SI unit meter m +metre meter + +/ special-case abbreviations cm centimeter mm millimeter km kilometer nm nanometer -micron micrometer + +/ other metric units angstrom decinanometer +fermi 1e-15 m +micron micrometer + +/ space-sized lengths +au 1.49597871e+11 m fuzz +astronomicalunit au +lightyear c-yr +parsec au-radian/arcsec +pc parsec +/ English system lengths inch 2.54 cm in inch foot 12 in @@ -155,43 +285,200 @@ feet foot ft foot yard 3 ft yd yard -rod 5.5 yd -rd rod mile 5280 ft mi mile +league 3 mi +mil 1e-3 in british 1200|3937 m/ft + +/ nautical +/ Historically, the nautical mile was 6080 feet (6080.2 in England) +/ but was changed to 1852 meters (6076 feet and change) in the 20th +/ century with varying dates of adoption around the world. +/ https://en.wikipedia.org/wiki/Nautical_mile +fathom 6 ft nmile 1852 m +nauticalmile nmile +marineleague 3 nmile +cable 720 ft +/ surveying +rod 5.5 yd +rd rod +perch rd +pole rd +chain 66 ft +link 66|100 ft +furlong 220 yd +surveyfoot british-ft +surveyyard 3 surveyfoot +surveyorschain 66 ft +surveyorslink 66|100 ft + +/ typographical +pica 1|6 in +point 1|72 in + +/ data centers and machine rooms +rackunit 1.75 in +RU rackunit +U rackunit + +/ physics +bohrradius hbar2-C2/8.988e9 N m2-e2-electronmass + +/ miscellaneous/historical/obscure English units +line 1|12 in +barleycorn 1|3 in +finger 7|8 in +nail 1|16 yd +palm 3 in +hand 4 in +quarter 9 in +span 9 in +cubit 18 in +militarypace 2.5 feet +pace 36 in +ell 45 in +smoot 67 in +rope 20 ft +bolt 40 yd +skein 120 yd +spindle 14400 yd + +/ more ells +flemishell 27 inch +scottishell 37.2 inch +englishell 45 inch + +/ I can't find supporting evidence for this definition. +rood 1.21e+3 yd + +/ other +geodeticfoot british-ft +geographicalmile 1852 m +engineerschain 100 ft +engineerslink 100|100 ft +gunterschain 22 yd + +/ note that while caliber is technically a unit, caliber sizes for ammunition +/ are usually short names for more complicated specifications. +caliber 1e-2 in + +frenchfoot 16|15 ft +frenchfeet frenchfoot +toise 6 frenchfeet + +parasang 3.5 mi + +/ Thai length + +krabiat 0.5208 cm +nio 4 krabiat +khuep 12 nio +sok 2 khuep +wah 4 sok +sen 20 wah +yot 400 sen + +/ //////////////////////////////////////////////////////////// +/ Speed + +admiraltyknot 6080 ft/hr +knot nmile/hr +mph mile/hr + +/ The speed of sound varies substantially with density, and thus +/ both pressure and temperature. This number appears to be for +/ 0 degrees Celsius at sea level. The value is considerably lower +/ at typical flight altitudes for high-performance aircraft. +mach 331.46 m/sec + +/ //////////////////////////////////////////////////////////// +/ Area + +/ metric +are 1e+2 m2 +hectare 1e+4 m2 + +/ English +sabin 1 ft2 +square 100 ft2 acre 4840 yd2 +homestead 1|4 mi2 +quartersection 1|4 mi2 +section mi2 +township 36 mi2 + +/ particle physics +barn 1e-28 m2 +shed 1e-24 barn + +/ Thai area +tarangwah wah2 +ngan 100 tarangwah +rai 4 ngan +/ //////////////////////////////////////////////////////////// +/ Volume + +/ metric cc cm3 liter kilocc +litre liter ml milliliter +stere m3 -/ US Liquid +/ US liquid volume gallon 231 in3 -imperial 1.20095 gal gallon quart 1|4 gal qt quart pint 1|2 qt pt pint - +cup 1|2 pt +gill 1|4 pt floz 1|16 pt +tablespoon 1|2 floz +teaspoon 1|3 tablespoon fldr 1|8 floz +minim 1|60 fldr + +barrel 42 gal +hogshead 63 gallon +hd hogshead + +noggin 1|8 qt +fifth 4|5 qt +firkin 9 gal +kilderkin 18 gal +pipe 4 barrel +tun 8 barrel -/ US Dry +/ US dry volume dry 268.8025 in3/gallon fuzz + peck 8 dry-quart pk peck bushel 4 peck bu bushel +strike 2 bu +sack 3 bu +coomb 4 bu +seam 8 bu chaldron 36 bushel +wey 40 bu +last 80 bu -/ British +cord 128 ft3 +cordfoot cord + +/ British volume + +imperial 1.20095 brgallon 277.420 in3 fuzz brquart 1|4 brgallon @@ -199,6 +486,7 @@ brpint 1|2 brquart brfloz 1|20 brpint brpeck 554.84 in3 fuzz brbushel 4 brpeck +cran 37.5 brgallon / Bottles @@ -225,35 +513,186 @@ tappithen 3 bottle rheoboam rehoboam shalmaneser salmanazar -/ Energy Work +/ //////////////////////////////////////////////////////////// +/ Force +/ SI unit newton kg-m/sec2 nt newton N newton -joule nt-m -watt joule/sec + +/ metric units +dyne cm-gm/sec2 +sthene 1e+3 nt + +/ foot/pound units +lbf lb g +kip 1000 lbf +poundal ft-lb/sec2 +pdl poundal + +/ //////////////////////////////////////////////////////////// +/ Pressure + +/ SI unit +pascal nt/m2 + +/ metric units +bar 1e+5 nt/m2 +barie 1e-1 nt/m2 +barye 1e-1 nt/m2 +pieze 1e+3 nt/m2 + +/ other +atmosphere 1.01325e+5 nt/m2 +atm atmosphere +psi lb-g/in2 +torr mm hg + +/ //////////////////////////////////////////////////////////// +/ Energy and work (and power) + +joule nt-m +watt joule/sec W watt + cal 4.1868 joule +calorie cal +kcal kilocal +kcalorie kilocal +frigorie kilocal + +britishthermalunit 1.05506e+3 joule fuzz +btu britishthermalunit +erg cm2-gm/sec2 +horsepower 550 ft-lb-g/sec +hp horsepower +therm 1e+5 btu +thermie 1e+6 cal +tnt 4.6e+6 m2/sec2 +/ //////////////////////////////////////////////////////////// +/ Temperature + +degC K +kelvin K +degF 5|9 degC +degreesrankine degF +degrankine degreesrankine +degreerankine degF +degreaumur 10|8 degC + +/ //////////////////////////////////////////////////////////// / Electrical +/ SI units coulomb coul C coul ampere coul/sec amp ampere +V volt volt watt/amp ohm volt/amp -mho /ohm farad coul/volt henry sec2/farad weber volt-sec +tesla weber/m2 -/ Light +/ special-case abbreviations +mh millihenry +pf picofarad + +/ other +biot 10 amp +debye 3.336e-30 coul-m +faraday 9.652e+4 coul +franklin 3.33564e-10 coul +gamma 1e-9 weber/m2 +gauss 1e-4 weber/m2 +gilbert 7.95775e-1 amp +kilohm kiloohm +maxwell 1e-8 weber +megohm megaohm +mho /ohm +oersted 2.5e+2 pi-amp/m +oe oersted +siemens /ohm +statcoul 1|2.99792458e9 coul +statamp 1|2.99792458e9 amp +statvolt 2.99792458e2 volt +statcoulomb statcoul +statampere statamp + +/ //////////////////////////////////////////////////////////// +/ more energy +eV e V +ev e-volt +electronvolt e-volt +bev 1e+9 e-volt +kev 1e+3 e-volt + +rydberg 1.36054e+1 ev + +/ //////////////////////////////////////////////////////////// +/ Radiant intensity (and related phenomena) + +/ SI units cd candela lumen cd sr lux cd sr/m2 +/ Miscellaneous units +apostilb cd/pi-m2 +blondel cd/pi-m2 +candle 1.02 candela +equivalentfootcandle lumen/pi-ft2 +equivalentlux lumen/pi-m2 +equivalentphot cd/pi-cm2 +footcandle lumen/ft2 +footlambert cd/pi-ft2 +hefnercandle .92 cd +lambert cd/pi-cm2 +nit cd/m2 +nox 1e-3 lux +phot lumen/cm2 +skot 1e-3 apostilb +stilb cd/cm2 + +langley cal/cm2 + +/ //////////////////////////////////////////////////////////// +/ Radioactivity and radiation dosimetry + +/ Activity + +becquerel /sec +Bq becquerel +curie 3.7e+10 /sec +Ci curie +rutherford 1e+6 /sec + +/ Absorbed radiation dose + +gray joule/kg +Gy gray +rad 100 erg/gm + +/ Equivalent radiation dose + +sievert joule/kg +Sv sievert +rem 1e-2 sievert + +/ Legacy radiation dose + +roentgen 2.58e-4 coulomb/kg +rontgen roentgen +R roentgen + +/ //////////////////////////////////////////////////////////// +/ Currency + / Wall Street Journal, July 2, 1993 $ dollar @@ -338,7 +777,12 @@ sucre ecuadorsucre poundsterling britainpound cruzeiro brazilcruzeiro -/ computer +buck dollar +cent centidollar +fin 5 dollar + +/ //////////////////////////////////////////////////////////// +/ size of data baud bit/sec byte 8 bit @@ -351,300 +795,46 @@ terabyte 1024 gigabyte petabyte 1024 terabyte -/ Trivia +/ //////////////////////////////////////////////////////////// +/ Trivia and miscellaneous units -% 1|100 -admiraltyknot 6080 ft/hr -apostilb cd/pi-m2 -are 1e+2 m2 arpentcan 27.52 mi arpentlin 191.835 ft -astronomicalunit au -atmosphere 1.01325e+5 nt/m2 -atm atmosphere -atomicmassunit 1.66044e-27 kg fuzz -amu atomicmassunit -bag 94 lb -bakersdozen 13 -bar 1e+5 nt/m2 -barie 1e-1 nt/m2 -barleycorn 1|3 in -barn 1e-28 m2 -barrel 42 gal -barye 1e-1 nt/m2 -bev 1e+9 e-volt -biot 10 amp -blondel cd/pi-m2 boardfoot 144 in3 -bolt 40 yd bottommeasure 1|40 in -britishthermalunit 1.05506e+3 joule fuzz -btu britishthermalunit refrigeration 12000 btu/ton-hour -buck dollar -Ci curie -cable 720 ft -caliber 1e-2 in -calorie cal -carat 205 mg caratgold 1|24 -cent centidollar -cental 100 lb -centesimalminute 1e-2 grade -centesimalsecond 1e-4 grade -century 100 year +ccs 1|36 erlang cfs ft3/sec -chain 66 ft circularinch 1|4 pi-in2 circularmil 1e-6|4 pi-in2 clusec 1e-8 mm-hg m3/s -coomb 4 bu -cord 128 ft3 -cordfoot cord crith 9.06e-2 gm -cubit 18 in -cup 1|2 pt -curie 3.7e+10 /sec -dalton amu -decade 10 yr diopter /m displacementton 35 ft3 doppelzentner 100 kg -dozen 12 drop .03 cm3 -dyne cm-gm/sec2 -electronvolt e-volt -ell 45 in -engineerschain 100 ft -engineerslink 100|100 ft -equivalentfootcandle lumen/pi-ft2 -equivalentlux lumen/pi-m2 -equivalentphot cd/pi-cm2 -erg cm2-gm/sec2 -ev e-volt -faraday 9.652e+4 coul -fathom 6 ft -fermi 1e-15 m -fifth 4|5 qt -fin 5 dollar -finger 7|8 in -firkin 9 gal -footcandle lumen/ft2 -footlambert cd/pi-ft2 -fortnight 14 da -franklin 3.33564e-10 coul -frigorie kilocal -furlong 220 yd -Gy gray galileo 1e-2 m/sec2 -gamma 1e-9 weber/m2 -gauss 1e-4 weber/m2 -geodeticfoot british-ft -geographicalmile 1852 m -gilbert 7.95775e-1 amp -gill 1|4 pt -gray joule/kg -gross 144 -gunterschain 22 yd -hand 4 in -hectare 1e+4 m2 -hefnercandle .92 cd -hertz /sec -Hz hertz -hogshead 63 gallon -hd hogshead -homestead 1|4 mi2 -horsepower 550 ft-lb-g/sec -hp horsepower -hyl gm force sec2/m -hz /sec imaginarycubicfoot 1.4 ft3 karat 1|24 -kcal kilocal -kcalorie kilocal -kev 1e+3 e-volt key kg -khz 1e+3 /sec -kilderkin 18 gal -knot nmile/hr -lambert cd/pi-cm2 -langley cal/cm2 -last 80 bu -league 3 mi -lightyear c-yr -line 1|12 in -link 66|100 ft -longhundredweight 112 lb -longquarter 28 lb lusec 1e-6 mm-hg m3/s -mach 331.46 m/sec -marineleague 3 nmile -maxwell 1e-8 weber -metriccarat 200 mg mgd megagal/day -mh millihenry -mhz 1e+6 /sec -mil 1e-3 in -millennium 1000 year minersinch 1.5 ft3/min -minim 1|60 fldr -mo month mpg mile/gal -mph mile/hr -nail 1|16 yd -nauticalmile nmile -nit cd/m2 -noggin 1|8 qt -nox 1e-3 lux -ns nanosec -oersted 2.5e+2 pi-amp/m -oe oersted -pace 36 in -palm 3 in -parasang 3.5 mi -parsec au-radian/arcsec -pascal nt/m2 -pc parsec -pennyweight 1|20 oz -pwt pennyweight -percent % -perch rd -pf picofarad -phot lumen/cm2 -pica 1|6 in -pieze 1e+3 nt/m2 -pipe 4 barrel -point 1|72 in poise gm/cm-sec -pole rd -poundal ft-lb/sec2 -pdl poundal -proof 1|200 -psi lb-g/in2 -quarter 9 in -quartersection 1|4 mi2 -quintal 100 kg -quire 25 -R roentgen -rackunit 1.75 in -rad 100 erg/gm -ream 500 registerton 100 ft3 -rem 1e-2 sievert rhe 10 m2/nt-sec -roentgen 2.58e-4 coulomb/kg -rontgen roentgen -rood 1.21e+3 yd -rope 20 ft -RU rackunit -rutherford 1e+6 /sec -rydberg 1.36054e+1 ev -Sv sievert -sabin 1 ft2 -sack 3 bu -score 20 -seam 8 bu -section mi2 -shed 1e-24 barn shippington 40 ft3 -shorthundredweight 100 lb -shortquarter 25 lb -siemens /ohm -sievert joule/kg -sigma microsec -skein 120 yd -skot 1e-3 apostilb -slug lb-g-sec2/ft -smoot 67 in -span 9 in -spat 4 pi sr -spindle 14400 yd -square 100 ft2 -stere m3 -sthene 1e+3 nt -stilb cd/cm2 stoke 1e-4 m2/sec -stone 14 lb -strike 2 bu -surveyfoot british-ft -surveyyard 3 surveyfoot -surveyorschain 66 ft -surveyorslink 66|100 ft -tablespoon 4 fldr -teaspoon 4|3 fldr -tesla weber/m2 -therm 1e+5 btu -thermie 1e+6 cal timberfoot ft3 -tnt 4.6e+6 m2/sec2 -tonne 1e+6 gm -torr mm hg -township 36 mi2 -tun 8 barrel -U rackunit water gram g / cc -wey 40 bu -weymass 252 lb Xunit 1.00202e-13 m -k 1.38047e-16 erg/degC - -degC K -kelvin K brewster 1e-12 m2/newton -degF 5|9 degC -degreesrankine degF -degrankine degreesrankine -degreerankine degF -degreaumur 10|8 degC -drachm 60 grain poncelet 100 kg m g / sec denier .05|450 gram / m tex .001 gram / m -englishell 45 inch -scottishell 37.2 inch -flemishell 27 inch -planck 6.626e-34 joule-sec -hbar 1.055e-34 joule-sec -electronmass 9.1095e-31 kg -protonmass 1.6726e-27 kg -neutronmass 1.6606e-27 kg -V volt -eV e V -bohrradius hbar2-C2/8.988e9 N m2-e2-electronmass -becquerel /sec -Bq becquerel -fresnel 1e12 hertz -statcoul 1|2.99792458e9 coul -statamp 1|2.99792458e9 amp -statvolt 2.99792458e2 volt -statcoulomb statcoul -statampere statamp -debye 3.336e-30 coul-m -pulsatance 2 pi/sec -rpm rev/minute -rps rev/sec -kilohm kiloohm -megohm megaohm -siderealyear 365.256360417 day -siderealday 23.934469444 hour -siderealhour 1|24 siderealday -lunarmonth 29.5305555 day -synodicmonth lunarmonth -siderealmonth 27.32152777 day -tropicalyear year -solaryear year -lunaryear 12 lunarmonth -cran 37.5 brgallon -kip 1000 lbf -frenchfoot 16|15 ft -frenchfeet frenchfoot -toise 6 frenchfeet -candle 1.02 candela -militarypace 2.5 feet -metre meter -litre liter -gramme gram iudiptheria 62.8 microgram iupenicillin .6 microgram iuinsulin 41.67 microgram @@ -654,27 +844,3 @@ worstedyarncount 1680 ft/pound metricyarncount meter/gram jewlerspoint 2 milligram -/ Thai length - -krabiat 0.5208 cm -nio 4 krabiat -khuep 12 nio -sok 2 khuep -wah 4 sok -sen 20 wah -yot 400 sen - -/ Thai area - -tarangwah wah2 -ngan 100 tarangwah -rai 4 ngan - -/ Thai weight - -salueng 3.75 gm -baht 4 salueng -tamlueng 4 baht -chang 20 tamlueng -hap 50 chang -