summaryrefslogtreecommitdiff
path: root/unitsfile.txt
blob: 78e51f7c06eaa79b3086be21223063a135b5e0e0 (plain)
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
# A file for the units in my unit converter program

# SI Base Units
# ! means "look for an existing unit which I will load at the start"
# This is necessary because every unit must be defined by others, and I need somewhere to start.

metre					!
kilogram				!
second					!
ampere					!
kelvin					!
mole					!
candela					!

# Symbols and aliases for base units

meter					metre
m						metre
kg						kilogram
s						second
A						ampere
K						kelvin
mol						mole
cd						candela

# the bit and byte, units of information

bit						!
b						bit
byte					8 bit
B						byte

# SI prefixes

deca-					10
deka-					deca
hecto-					100
kilo-					1e3
mega-					1e6
giga-					1e9
tera-					1e12
peta-					1e15
exa-					1e18
zetta-					1e21
yotta-					1e24

deci-					1e-1
centi-					1e-2
milli-					1e-3
micro-					1e-6
nano-					1e-9
pico-					1e-12
femto-					1e-15
atto-					1e-18
zepto-					1e-21
yocto-					1e-24

D-						deca
h-						hecto
H-						hecto
k-						kilo
K-						kilo
M-						mega
G-						giga
T-						tera
P-						peta
E-						exa
Z-						zetta
Y-						yotta

d-						deci
c-						centi
m-						milli
u-						micro
n-						nano
p-						pico
f-						femto
a-						atto
z-						zepto
y-						yocto

# Binary prefixes (i.e. metric but 1024 replaces 1000)

kibi-					1024^1
mebi-					1024^2
gibi-					1024^3
tebi-					1024^4
pebi-					1024^5
exbi-					1024^6
Ki-						kibi
Mi-						mebi
Gi-						gibi
Ti-						tebi
Pi-						pebi
Ei-						exbi

# Derived SI units
# Note: it is best to have these before any non-SI units

newton					kg m / s^2
N						newton
pascal					N / m^2
Pa						pascal
joule					N m
J						joule
watt					J/s
W						watt
coulomb					A s
C						coulomb
volt					W/A
V						volt
ohm						V/A
siemens					A/V
S						siemens
farad					C/V
F						farad
weber					V s
Wb						weber
henry					V s / A
H						henry
tesla					Wb / m^2
T						tesla
hertz					s^-1
Hz						hertz

# Angle units and constants

# Tau is the circle constant, equal to a circle's diameter divided by its radius
tau						6.28318530717958
# Another common circle constant
pi						tau / 2

radian					m / m
rad						radian
steradian				m^2 / m^2
sr						steradian
degree					360 / tau * radian
deg						degree
°						degree

# Nonlinear units, which are not supported by the file reader and must be defined manually
# Use tempC(100) for 100 degrees Celsius

tempCelsius				!
tempFahrenheit			!
tempC					tempCelsius
tempF					tempFahrenheit

# Common time units
minute					60 second
min						minute
hour					3600 second
h						hour
day						86400 second
d						day
julianyear				365.25 day
gregorianyear			365.2425 day

# Other non-SI "metric" units
litre					0.001 m^3
liter					litre
l						litre
L						litre
tonne					1000 kg
t						tonne
are						100 m^2
hectare					hectoare
arcminute				1 / 60 degree
arcmin					arcminute
arcsecond				1 / 60 arcminute
arcsec					arcsecond

# constants
waterdensity			1 kilogram / litre

# Imperial length units
foot					0.3048 m
ft						foot
inch					1 / 12 foot
in						inch
yard					3 foot
yd						yard
mile					1760 yard
mi						mile

# Imperial weight units
pound					0.45359237 kg
lb						pound
ounce					pound / 16
oz						ounce
stone					14 lb
UShundredweight			100 lb
UKhundredweight			8 stone
USimperialton			20 UShundredweight
UKimperialton			10 UKhundredweight

# Imperial volume units
UKfluidounce			ounce / waterdensity
UKfloz					UKfluidounce
UKcup					10 UKfloz
UKpint					2 UKcup
UKquart					2 UKpint
UKgallon				4 UKquart
UKgal					UKgallon

USgallon				231 inch^3
USgal					USgallon
USquart					USgallon / 4
USpint					USquart / 2
UScup					USpint / 2
USfluidounce			UScup / 8
USfloz					USfluidounce
UStablespoon			USfluidounce / 2
UStbsp					UStablespoon
USteaspoon				UStablespoon / 3
UStsp					USteaspoon

# Metric versions!
# tsp = 5 mL, tbsp = 15 mL, floz = 30 mL, cup = 240 mL, pint = 480 mL, quart = 960 mL, gallon = 3840 mL
# only metrictsp, metrictbsp and metriccup are common, the rest are derived from the US formulae with 240 mL cup
metricteaspoon			5 mL
teaspoon				metricteaspoon
tsp						metricteaspoon
metrictablespoon		3 metricteaspoon
tablespoon				metrictablespoon
tbsp					metrictablespoon
metricfluidounce		2 metrictablespoon
metriccup				8 metricfluidounce
cup						metriccup
metricpint				2 metriccup
pint					metricpint
metricquart				2 metricpint
quart					metricquart
metricgallon			4 metricquart