1 /* A small database of elementary unit conversions */
3 /* Undefined and therefore treated as basic units:
9 declare_unit_conversion
10 (Hz = 1/s, /* hertz: Frequency */
12 N = kg*m/s^2, /* newton: Force */
14 Pa = N/m^2, /* pascal: Pressure */
16 J = N*m, /* joule: Work, energy */
18 W = J/s, /* watt: Power */
20 C = s*A, /* coulomb: Electric charge */
22 V = J/C, /* volt: Electromotive force */
24 F = C^2/J, /* farad: Electric capacitance */
26 Ohm = J*s/C^2, /* ohm: Electric resistance */
28 S = 1/Ohm, /* siemens: Electric conductance */
30 Wb = J/A, /* weber: Magnetic flux */
32 T = J/m^2/A, /* tesla: Magnetic flux density*/
34 H = J/A^2, /* henry: Inductance */
97 Mmol = 1000000000*mol,
103 microhertz = microHz,
113 micronewton = microN,
123 micropascal = microPa,
153 microcoulomb = microC,
186 GOhm = 1000000000*Ohm,
192 microsiemens = microS,
202 microweber = microWb,
228 micrometer = m/1000000,
234 /* International Astronomical Union best estimate (2009) according to Wikipedia */
235 astronomical_unit = 149597870700 * m,
236 AU = astronomical_unit,
238 julian_year = (365 + 1/4) * 86400 * s,
239 light_year = julian_year * 299792458 * m / s,
241 parsec = 360 * 60 * 60 / (2 * %pi) * astronomical_unit,
244 microgram = kg/1000000000,
249 microsecond = s/1000000,
274 texput (mOhm, "\\mathrm{m\\Omega}");
275 texput (Ohm, "\\mathrm{\\Omega}");
276 texput (kOhm, "\\mathrm{k\\Omega}");
277 texput (MOhm, "\\mathrm{M\\Omega}");
278 texput (GOhm, "\\mathrm{G\\Omega}");
280 texput (micrometer, "\\mu \\mathrm{m}");
281 texput (microm, "\\mu \\mathrm{m}");
282 texput (micron, "\\mu \\mathrm{m}");
283 texput (microgram, "\\mu \\mathrm{g}");
284 texput (microg, "\\mu \\mathrm{g}");
285 texput (microsecond, "\\mu \\mathrm{s}");
286 texput (micros, "\\mu \\mathrm{s}");
287 texput (microampere, "\\mu \\mathrm{A}");
288 texput (microamp, "\\mu \\mathrm{A}");
289 texput (microA, "\\mu \\mathrm{A}");
290 texput (microkelvin, "\\mu \\mathrm{K}");
291 texput (microK, "\\mu \\mathrm{K}");
292 texput (micromole, "\\mu \\mathrm{mol}");
293 texput (micromol, "\\mu \\mathrm{mol}");
294 texput (microhertz, "\\mu \\mathrm{Hz}");
295 texput (microHz, "\\mu \\mathrm{Hz}");
296 texput (micronewton, "\\mu \\mathrm{N}");
297 texput (microN, "\\mu \\mathrm{N}");
298 texput (micropascal, "\\mu \\mathrm{Pa}");
299 texput (microPa, "\\mu \\mathrm{Pa}");
300 texput (microjoule, "\\mu \\mathrm{J}");
301 texput (microJ, "\\mu \\mathrm{J}");
302 texput (microwatt, "\\mu \\mathrm{W}");
303 texput (microW, "\\mu \\mathrm{W}");
304 texput (microcoulomb, "\\mu \\mathrm{C}");
305 texput (microC, "\\mu \\mathrm{C}");
306 texput (microvolt, "\\mu \\mathrm{V}");
307 texput (microV, "\\mu \\mathrm{V}");
308 texput (microfarad, "\\mu \\mathrm{F}");
309 texput (microF, "\\mu \\mathrm{F}");
310 texput (microOhm, "\\mu \\Omega");
311 texput (microsiemens, "\\mu \\mathrm{S}");
312 texput (microS, "\\mu \\mathrm{S}");
313 texput (microweber, "\\mu \\mathrm{Wb}");
314 texput (microWb, "\\mu \\mathrm{Wb}");
315 texput (microtesla, "\\mu \\mathrm{T}");
316 texput (microT, "\\mu \\mathrm{T}");
317 texput (microhenry, "\\mu \\mathrm{H}");
318 texput (microH, "\\mu \\mathrm{H}");
320 texput (metric_ton, "\\mathrm{metric\\ ton}");
322 declare_unit_conversion
323 (feet = 3048/10000 * m,
324 /* International pound avoirdupois */
325 pound_mass = 45359237/10^8 * kg,
330 month = (30 + 7/16)*86400*s,
331 year = (365 + 1/4)*86400*s,
335 declare_unit_conversion
340 slug = pound_force*s^2/foot,
341 ounce = pound_mass/16,
343 /* assume gravitational acceleration = 980.665 cm/s^2 */
344 pound_force = pound_mass*196133/6096*ft/s^2,
346 psi = pound_force/inch^2,
354 horsepower = 550 * pound_force * foot / s,
357 short_ton = 2000*lbm,
364 fluid_ounce = cup / 8,
366 tablespoon = fluid_ounce / 2,
367 teaspoon = tablespoon / 3,