forked from bcicen/go-units
-
Notifications
You must be signed in to change notification settings - Fork 0
/
length_units.go
44 lines (40 loc) · 1.42 KB
/
length_units.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package units
var (
Length = UnitOptionQuantity("length")
// metric
Meter = NewUnit("meter", "m", Length, SI, UnitOptionAliases("metre"))
ExaMeter = Exa(Meter)
PetaMeter = Peta(Meter)
TeraMeter = Tera(Meter)
GigaMeter = Giga(Meter)
MegaMeter = Mega(Meter)
KiloMeter = Kilo(Meter)
HectoMeter = Hecto(Meter)
DecaMeter = Deca(Meter)
DeciMeter = Deci(Meter)
CentiMeter = Centi(Meter)
MilliMeter = Milli(Meter)
MicroMeter = Micro(Meter)
NanoMeter = Nano(Meter)
PicoMeter = Pico(Meter)
FemtoMeter = Femto(Meter)
AttoMeter = Atto(Meter)
Angstrom = NewUnit("angstrom", "Å", Length, BI, UnitOptionPlural("angstroms"))
Inch = NewUnit("inch", "in", Length, BI, UnitOptionPlural("inches"))
Foot = NewUnit("foot", "ft", Length, BI, UnitOptionPlural("feet"))
Yard = NewUnit("yard", "yd", Length, BI)
Mile = NewUnit("mile", "mi", Length, BI)
NauticalMile = NewUnit("nautical mile", "nmi", Length, BI)
League = NewUnit("league", "lea", Length, BI)
Furlong = NewUnit("furlong", "fur", Length, BI)
)
func init() {
NewRatioConversion(Angstrom, Meter, 0.0000000001)
NewRatioConversion(Inch, Meter, 0.0254)
NewRatioConversion(Foot, Meter, 0.3048)
NewRatioConversion(Yard, Meter, 0.9144)
NewRatioConversion(Mile, Meter, 1609.344)
NewRatioConversion(NauticalMile, Meter, 1852)
NewRatioConversion(League, Meter, 4828.032)
NewRatioConversion(Furlong, Meter, 201.168)
}