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