]> gitweb.factorcode.org Git - factor.git/blob - extra/units/imperial/imperial.factor
Fixing basis -> extra dependencies
[factor.git] / extra / units / imperial / imperial.factor
1 USING: kernel math prettyprint units units.si inverse ;
2 IN: units.imperial
3
4 : inches ( n -- dimensioned ) 254/100 * cm ;
5
6 : feet ( n -- dimensioned ) 12 * inches ;
7
8 : yards ( n -- dimensioned ) 3 * feet ;
9
10 : miles ( n -- dimensioned ) 1760 * yards ;
11
12 : nautical-miles ( n -- dimensioned ) 1852 * m ;
13
14 : pounds ( n -- dimensioned ) 22/10 / kg ;
15
16 : ounces ( n -- dimensioned ) 1/16 * pounds ;
17
18 : gallons ( n -- dimensioned ) 379/100 * L ;
19
20 : quarts ( n -- dimensioned ) 1/4 * gallons ;
21
22 : pints ( n -- dimensioned ) 1/2 * quarts ;
23
24 : cups ( n -- dimensioned ) 1/2 * pints ;
25
26 : fluid-ounces ( n -- dimensioned ) 1/16 * pints ;
27
28 : teaspoons ( n -- dimensioned ) 1/6 * fluid-ounces ;
29
30 : tablespoons ( n -- dimensioned ) 1/2 * fluid-ounces ;
31
32 : knots ( n -- dimensioned ) 1852/3600 * m/s ;
33
34 : deg-F ( n -- dimensioned ) 32 - 5/9 * deg-C ;
35
36 : imperial-gallons ( n -- dimensioned ) 454609/100000 * L ;
37
38 : imperial-quarts ( n -- dimensioned ) 1/4 * imperial-gallons ;
39
40 : imperial-pints ( n -- dimensioned ) 1/2 * imperial-quarts ;
41
42 : imperial-fluid-ounces ( n -- dimensioned ) 1/160 * imperial-gallons ;
43
44 : imperial-gill ( n -- dimensioned ) 5 * imperial-fluid-ounces ;
45
46 : dry-gallons ( n -- dimensioned ) 440488377086/100000000000 * L ; 
47
48 : dry-quarts ( n -- dimensioned ) 1/4 * dry-gallons ;
49
50 : dry-pints ( n -- dimensioned ) 1/2 * dry-quarts ;
51
52 : pecks ( n -- dimensioned ) 8 * dry-quarts ;
53
54 : bushels ( n -- dimensioned ) 4 * pecks ;
55
56 : rods ( n -- dimensioned ) 11/2 * yards ;
57
58
59
60
61
62
63 ! rod, hogshead, barrel, peck, metric ton, imperial ton..