1 .\" $NetBSD: units.1,v 1.12 2002/09/30 11:09:15 grant Exp $
18 converts quantities expression in various scales to
19 their equivalents in other scales.
21 can only handle multiplicative scale changes.
22 It cannot convert Centigrade to Fahrenheit, for example.
24 The following options are supported:
25 .Bl -tag -width "from-unit to-unit" -offset indent
27 Specifies the name of the units data file to load.
29 Suppresses prompting of the user for units and the display of statistics
30 about the number of units loaded.
32 Prints the version number.
33 .It Ar from-unit Ar to-unit
34 Allows a single unit conversion to be done directly from the command
36 No prompting will occur.
38 will print out only the result of this single conversion.
41 argument can be prepended to the
43 or it can be separate.
47 works interactively by prompting the user for input:
60 Powers of units can be specified using the
62 character as shown in the example, or by simple concatenation:
66 Multiplication of units can be specified by using spaces, a dash or
68 Division of units is indicated by the slash
70 Note that multiplication has a higher precedence than division,
77 If the user enters incompatible unit types, the
79 program will print a message indicating that the units are not
80 conformable and it will display the reduced form for each unit:
83 You want: fathoms kg^2 / day
85 2.7777778e-11 kg m^2 / sec^3
86 2.1166667e-05 kg^2 m / sec
89 The conversion information is read from a units data file.
91 file includes definitions for most familiar units, abbreviations and
93 Some constants of nature included are:
94 .Bl -tag -width mercury -compact -offset indent
96 ratio of circumference to diameter
100 charge on an electron
102 acceleration of gravity
108 pressure per unit height of water
110 pressure per unit height of mercury
117 Compound names are run together
121 British units that differ from their
122 US counterparts are prefixed with
124 and currency is prefixed with
129 a unit, if the specified string does not appear exactly as a unit
132 program will try to remove a trailing
136 and check again for a match.
138 All of these definitions can be read in the standard units file, or you
139 can supply your own file.
140 A unit is specified on a single line by
141 giving its name and an equivalence.
142 One should be careful to define
143 new units in terms of old ones so that a reduction leads to the
144 primitive units which are marked with
148 will not detect infinite loops that could be caused
149 by careless unit definitions.
151 Prefixes are defined in the same was as standard units, but with
152 a trailing dash at the end of the prefix name.
154 .Bl -tag -width /usr/share/misc/units.lib -compact
155 .It Pa /usr/share/misc/units.lib
156 the standard units library
159 .An Adrian Mariano Aq adrian@cam.cornell.edu
161 .Aq mariano@geom.umn.edu
163 The effect of including a
165 in a prefix is surprising.
167 Exponents entered by the user can be only one digit.
168 You can work around this by multiplying several terms.
172 to indicate division of numbers and
174 to indicate division of symbols.
175 This distinction should not be necessary.
177 The program contains various arbitrary limits on the length
178 of the units converted and on the length of the data file.
180 The program should use a hash table to store units so that
181 it doesn't take so long to load the units list and check