Annotation of src/usr.bin/units/units.1, Revision 1.3
1.3 ! deraadt 1: .\" $OpenBSD: units.1,v 1.6 1996/04/06 06:01:02 thorpej Exp $
1.2 deraadt 2: .\" $NetBSD: units.1,v 1.6 1996/04/06 06:01:02 thorpej Exp $
1.1 deraadt 3: .TH UNITS 1 "14 July 1993"
4: .SH NAME
5: units - conversion program
6: .SH SYNTAX
7: .B units
8: [-f filename] [-qv] [from-unit to-unit]
9: .SH SUMMARY
10: .TP 4
11: .B -f filename
12: Specifies the name of the units data file to load.
13: .LP
14: .TP 4
15: .B -q
16: Suppresses prompting of the user for units and the display of statistics
17: about the number of units loaded.
18: .LP
19: .TP 4
20: .B -v
21: Prints the version number.
22: .LP
23: .TP 4
24: .B from-unit to-unit
25: Allows a single unit conversion to be done directly from the command
26: line. No prompting will occur. The units program will print out
27: only the result of this single conversion.
28:
29: .SH DESCRIPTION
30: The units program converts quantities expression in various scales to
31: their equivalents in other scales. The units program can only
32: handle multiplicative scale changes. It cannot convert Centigrade
33: to Fahrenheit, for example. It works interactively by prompting
34: the user for input:
35: .nf
36:
37: You have: meters
38: You want: feet
39: * 3.2808399
40: / 0.3048
41:
42: You have: cm^3
43: You want: gallons
44: * 0.00026417205
45: / 3785.4118
46:
47: .fi
48: Powers of units can be specified using the '^' character as shown in
49: the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'.
50: Multiplication of units can be specified by using spaces, a dash or
51: an asterisk. Division of units is indicated by the slash ('/').
52: Note that multiplication has a higher precedence than division,
53: so 'm/s/s' is the same as 'm/s^2' or 'm/s s'.
54: If the user enters incompatible unit types, the units program will
55: print a message indicating that the units are not conformable and
56: it will display the reduced form for each unit:
57: .nf
58:
59: You have: ergs/hour
60: You want: fathoms kg^2 / day
61: conformability error
62: 2.7777778e-11 kg m^2 / sec^3
63: 2.1166667e-05 kg^2 m / sec
64:
65: .fi
66: .LP
67: The conversion information is read from a units data file. The default
68: file includes definitions for most familiar units, abbreviations and
69: metric prefixes. Some constants of nature included are:
70: .in +4m
71: .ta
72: .ta 9m +
73: .nf
74:
75: pi ratio of circumference to diameter
76: c speed of light
77: e charge on an electron
78: g acceleration of gravity
79: force same as g
80: mole Avogadro's number
81: water pressure per unit height of water
82: mercury pressure per unit height of mercury
83: au astronomical unit
84:
85: .fi
86: .in -4m
87: \'Pound' is a unit of mass. Compound names are run together
88: so 'poundforce' is a unit of force. British units that differ from their
89: US counterparts are prefixed with 'br', and currency is prefixed with
90: its country name: 'belgiumfranc', 'britainpound'. When searching for
91: a unit, if the specified string does not appear exactly as a unit
92: name, then the units program will try to remove a trailing 's' or
93: a trailing 'es' and check again for a match.
94: .LP
95: All of these definitions can be read in the standard units file, or you
96: can supply your own file. A unit is specified on a single line by
97: giving its name and an equivalence. One should be careful to define
98: new units in terms of old ones so that a reduction leads to the
99: primitive units which are marked with '!' characters.
100: The units program will not detect infinite loops that could be caused
101: by careless unit definitions.
102: .LP
103: Prefixes are defined in the same was as standard units, but with
104: a trailing dash at the end of the prefix name.
105: .SH BUGS
106: .LP
107: The effect of including a '/' in a prefix is surprising.
108: .LP
109: Exponents entered by the user can be only one digit.
110: You can work around this by multiplying several terms.
111: .LP
112: The user must use | to indicate division of numbers and / to
113: indicate division of symbols. This distinction should not
114: be necessary.
115: .LP
116: The program contains various arbitrary limits on the length
117: of the units converted and on the length of the data file.
118: .LP
119: The program should use a hash table to store units so that
120: it doesn't take so long to load the units list and check
121: for duplication.
122: .SH FILES
123: /usr/share/misc/units.lib - the standard units library
124: .SH AUTHOR
125: Adrian Mariano (adrian@cam.cornell.edu or mariano@geom.umn.edu)