|
3 | 3 |
|
4 | 4 | from quantities.units.unitquantity import UnitLength |
5 | 5 |
|
6 | | -m = meter = meters = metre = metres = \ |
7 | | - UnitLength('m') |
8 | | -km = kilometer = kilometers = kilometre = kilometres = \ |
9 | | - UnitLength('km', 1000*m) |
10 | | -cm = centimeter = centimeters = centimetre = centimetres = \ |
11 | | - UnitLength('cm', m/100) |
12 | | -mm = millimeter = millimeters = millimetre = millimetres = \ |
13 | | - UnitLength('mm', m/1000) |
14 | | -um = micron = microns = micrometer = micrometers = micrometre = micrometres = \ |
15 | | - UnitLength('um', mm/1000) |
16 | | -nm = nanometer = nanometers = nanometre = nanometres = \ |
17 | | - UnitLength('nm', um/1000) |
18 | | -pm = picometer = picometers = picometre = picometres = \ |
19 | | - UnitLength('pm', nm/1000) |
20 | | -angstrom = angstroms = \ |
21 | | - UnitLength('angstroms', nm/10) |
22 | | -fm = femtometer = femtometer = femtometre = femtometres = \ |
23 | | - UnitLength('fm', nm/1000) |
| 6 | +m = UnitLength( |
| 7 | + 'm', |
| 8 | + aliases=['meter', 'meters', 'metre', 'metres'] |
| 9 | +) |
| 10 | +km = UnitLength( |
| 11 | + 'km', 1000*m, aliases=['kilometer', 'kilometers', 'kilometre', 'kilometres'] |
| 12 | +) |
| 13 | +cm = UnitLength( |
| 14 | + 'cm', m/100, |
| 15 | + aliases=['centimeter', 'centimeters', 'centimetre', 'centimetres'] |
| 16 | +) |
| 17 | +mm = UnitLength( |
| 18 | + 'mm', m/1000, |
| 19 | + aliases=['millimeter', 'millimeters', 'millimetre', 'millimetres'] |
| 20 | +) |
| 21 | +um = UnitLength( |
| 22 | + 'um', mm/1000, |
| 23 | + aliases=[ |
| 24 | + 'micron', 'microns', 'micrometer', 'micrometers', 'micrometre', |
| 25 | + 'micrometres' |
| 26 | + ] |
| 27 | +) |
| 28 | +nm = UnitLength( |
| 29 | + 'nm', um/1000, |
| 30 | + aliases=['nanometer', 'nanometers', 'nanometre', 'nanometres'] |
| 31 | +) |
| 32 | +pm = UnitLength( |
| 33 | + 'pm', nm/1000, |
| 34 | + aliases=['picometer', 'picometers', 'picometre', 'picometres'] |
| 35 | +) |
| 36 | +angstrom = UnitLength( |
| 37 | + 'angstroms', nm/10, |
| 38 | + aliases=['angstroms'] |
| 39 | +) |
| 40 | +fm = UnitLength( |
| 41 | + 'fm', nm/1000, |
| 42 | + aliases=['femtometer', 'femtometer', 'femtometre', 'femtometres'] |
| 43 | +) |
24 | 44 |
|
25 | | -inch = inches = international_inch = international_inches = \ |
26 | | - UnitLength('inch', 2.54*cm) |
27 | | -ft = foot = feet = international_foot = international_feet = \ |
28 | | - UnitLength('ft', 12*inch) |
29 | | -mi = mile = miles = international_mile = international_miles = \ |
30 | | - UnitLength('mi', 5280*ft) |
31 | | -yd = yard = yards = international_yard = international_yards = \ |
32 | | - UnitLength('yd', 3*ft) |
33 | | -mil = mils = \ |
34 | | - UnitLength('mil', 2.54e-5*m) |
35 | | -pc = parsec = parsecs = \ |
36 | | - UnitLength('parsec', 3.08568025e16*meter) |
37 | | -ly = light_year = light_years = \ |
38 | | - UnitLength('light_year', 9.4605284e15*m) |
39 | | -au = astronomical_unit = astronomical_units = \ |
40 | | - UnitLength('au', 149597870691*m) |
41 | | -fermi = fermis = \ |
42 | | - UnitLength('fermi', 1e-15*m) |
43 | | -nmi = nmile = nmiles = nautical_mile = nautical_miles = \ |
44 | | - UnitLength('nautical_mile', 1.852e3*m) |
45 | | -printers_point = printers_points = \ |
46 | | - UnitLength('printers_point', 3.514598e-4*m) # TODO: check |
47 | | -pica = picas = printers_pica = printers_picas = \ |
48 | | - UnitLength('pica', 12*printers_point) |
| 45 | +inch = UnitLength( |
| 46 | + 'inch', 2.54*cm, |
| 47 | + aliases=['inches', 'international_inch', 'international_inches'] |
| 48 | +) |
| 49 | +ft = UnitLength( |
| 50 | + 'ft', 12*inch, |
| 51 | + aliases=['foot', 'feet', 'international_foot', 'international_feet'] |
| 52 | +) |
| 53 | +mi = UnitLength( |
| 54 | + 'mi', 5280*ft, |
| 55 | + aliases=['mile', 'miles', 'international_mile', 'international_miles'] |
| 56 | +) |
| 57 | +yd = UnitLength( |
| 58 | + 'yd', 3*ft, |
| 59 | + aliases=['yard', 'yards', 'international_yard', 'international_yards'] |
| 60 | +) |
| 61 | +mil = UnitLength( |
| 62 | + 'mil', 2.54e-5*m, |
| 63 | + aliases=['mils'] |
| 64 | +) |
| 65 | +pc = UnitLength( |
| 66 | + 'pc', 3.08568025e16*m, |
| 67 | + aliases=['parsec', 'parsecs'] |
| 68 | +) |
| 69 | +ly = UnitLength( |
| 70 | + 'light_year', 9.4605284e15*m, |
| 71 | + aliases=['light_year', 'light_years'] |
| 72 | +) |
| 73 | +au = UnitLength( |
| 74 | + 'au', 149597870691*m, |
| 75 | + aliases=['astronomical_unit', 'astronomical_units'] |
| 76 | +) |
| 77 | +fermi = UnitLength( |
| 78 | + 'fermi', 1e-15*m, |
| 79 | + aliases=['fermis'] |
| 80 | +) |
| 81 | +nmi = UnitLength( |
| 82 | + 'nautical_mile', 1.852e3*m, |
| 83 | + aliases=['nmile', 'nmiles', 'nautical_mile', 'nautical_miles'] |
| 84 | +) |
| 85 | +printers_point = UnitLength( |
| 86 | + 'printers_point', 3.514598e-4*m, # TODO: check |
| 87 | + aliases=['printers_points'] |
| 88 | +) |
| 89 | +pica = UnitLength( |
| 90 | + 'pica', 12*printers_point, |
| 91 | + aliases=['picas', 'printers_pica', 'printers_picas'] |
| 92 | +) |
49 | 93 |
|
50 | | -US_survey_foot = US_survey_feet = \ |
51 | | - UnitLength('US_survey_foot', 1200*m/3937) |
52 | | -US_survey_yard = US_survey_yards = \ |
53 | | - UnitLength('US_survey_yard', 3*US_survey_foot) |
54 | | -US_survey_mile = US_survey_miles = \ |
55 | | - UnitLength('US_survey_mile', 5280*US_survey_foot) |
56 | | -US_statute_mile = US_statute_miles = \ |
57 | | - UnitLength('US_statute_mile', US_survey_mile) |
58 | | -rod = rods = pole = poles = perch = perches = \ |
59 | | - UnitLength('rod', 16.5*US_survey_foot) # TODO: check, google uses foot |
60 | | -furlong = furlongs = \ |
61 | | - UnitLength('furlong', 660*US_survey_foot) |
62 | | -fathom = fathoms = \ |
63 | | - UnitLength('fathom', 6*US_survey_foot) |
64 | | -chain = chains = \ |
65 | | - UnitLength('chain', 2.011684e1*m) # TODO: check |
66 | | -big_point = big_points = \ |
67 | | - UnitLength('big_point', inch/72) |
68 | | -barleycorn = barleycorns = \ |
69 | | - UnitLength('barleycorn', inch/3) |
70 | | -arpentlin = \ |
71 | | - UnitLength('arpentlin', 191.835*foot) |
| 94 | +US_survey_foot = UnitLength( |
| 95 | + 'US_survey_foot', 1200*m/3937, |
| 96 | + aliases=['US_survey_feet'] |
| 97 | +) |
| 98 | +US_survey_yard = UnitLength( |
| 99 | + 'US_survey_yard', 3*US_survey_foot, |
| 100 | + aliases=['US_survey_yards'] |
| 101 | +) |
| 102 | +US_survey_mile = UnitLength( |
| 103 | + 'US_survey_mile', 5280*US_survey_foot, |
| 104 | + aliases=['US_survey_miles'] |
| 105 | +) |
| 106 | +US_statute_mile = UnitLength( |
| 107 | + 'US_statute_mile', US_survey_mile, |
| 108 | + aliases=['US_statute_miles'] |
| 109 | +) |
| 110 | +rod = UnitLength( |
| 111 | + 'rod', 16.5*US_survey_foot, # TODO: check NIST, google uses foot |
| 112 | + aliases=['rods', 'pole', 'poles', 'perch', 'perches'] |
| 113 | +) |
| 114 | +furlong = UnitLength( |
| 115 | + 'furlong', 660*US_survey_foot, |
| 116 | + aliases=['furlongs'] |
| 117 | +) |
| 118 | +fathom = UnitLength( |
| 119 | + 'fathom', 6*US_survey_foot, |
| 120 | + aliases=['fathoms'] |
| 121 | +) |
| 122 | +chain = UnitLength( |
| 123 | + 'chain', 2.011684e1*m, # TODO: check |
| 124 | + aliases=['chains'] |
| 125 | +) |
| 126 | +big_point = UnitLength( |
| 127 | + 'big_point', inch/72, |
| 128 | + aliases=['big_points'] |
| 129 | +) |
| 130 | +barleycorn = UnitLength( |
| 131 | + 'barleycorn', inch/3, |
| 132 | + aliases=['barleycorns'] |
| 133 | +) |
| 134 | +arpentlin = UnitLength( |
| 135 | + 'arpentlin', 191.835*ft |
| 136 | +) |
0 commit comments