-
Notifications
You must be signed in to change notification settings - Fork 22
/
electric_current.go
135 lines (112 loc) · 3.81 KB
/
electric_current.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package unit
// ElectricCurrent represents a SI unit of electric current (in ampere, A)
type ElectricCurrent Unit
// ...
const (
// SI
Yoctoampere = Ampere * 1e-24
Zeptoampere = Ampere * 1e-21
Attoampere = Ampere * 1e-18
Femtoampere = Ampere * 1e-15
Picoampere = Ampere * 1e-12
Nanoampere = Ampere * 1e-9
Microampere = Ampere * 1e-6
Milliampere = Ampere * 1e-3
Deciampere = Ampere * 1e-2
Centiampere = Ampere * 1e-1
Ampere ElectricCurrent = 1e0
Decaampere = Ampere * 1e1
Hectoampere = Ampere * 1e2
Kiloampere = Ampere * 1e3
Megaampere = Ampere * 1e6
Gigaampere = Ampere * 1e9
Teraampere = Ampere * 1e12
Petaampere = Ampere * 1e15
Exaampere = Ampere * 1e18
Zettaampere = Ampere * 1e21
Yottaampere = Ampere * 1e24
)
// Yoctoamperes returns the electric current in yA
func (c ElectricCurrent) Yoctoamperes() float64 {
return float64(c / Yoctoampere)
}
// Zeptoamperes returns the electric current in zA
func (c ElectricCurrent) Zeptoamperes() float64 {
return float64(c / Zeptoampere)
}
// Attoamperes returns the electric current in aA
func (c ElectricCurrent) Attoamperes() float64 {
return float64(c / Attoampere)
}
// Femtoamperes returns the electric current in fA
func (c ElectricCurrent) Femtoamperes() float64 {
return float64(c / Femtoampere)
}
// Picoamperes returns the electric current in pA
func (c ElectricCurrent) Picoamperes() float64 {
return float64(c / Picoampere)
}
// Nanoamperes returns the electric current in nA
func (c ElectricCurrent) Nanoamperes() float64 {
return float64(c / Nanoampere)
}
// Microamperes returns the electric current in µA
func (c ElectricCurrent) Microamperes() float64 {
return float64(c / Microampere)
}
// Milliamperes returns the electric current in mA
func (c ElectricCurrent) Milliamperes() float64 {
return float64(c / Milliampere)
}
// Deciamperes returns the electric current in dA
func (c ElectricCurrent) Deciamperes() float64 {
return float64(c / Deciampere)
}
// Centiamperes returns the electric current in cA
func (c ElectricCurrent) Centiamperes() float64 {
return float64(c / Centiampere)
}
// Amperes returns the electric current in A
func (c ElectricCurrent) Amperes() float64 {
return float64(c / Ampere)
}
// Decaamperes returns the electric current in daA
func (c ElectricCurrent) Decaamperes() float64 {
return float64(c / Decaampere)
}
// Hectoamperes returns the electric current in hA
func (c ElectricCurrent) Hectoamperes() float64 {
return float64(c / Hectoampere)
}
// Kiloamperes returns the electric current in kA
func (c ElectricCurrent) Kiloamperes() float64 {
return float64(c / Kiloampere)
}
// Megaamperes returns the electric current in MA
func (c ElectricCurrent) Megaamperes() float64 {
return float64(c / Megaampere)
}
// Gigaamperes returns the electric current in GA
func (c ElectricCurrent) Gigaamperes() float64 {
return float64(c / Gigaampere)
}
// Teraamperes returns the electric current in TA
func (c ElectricCurrent) Teraamperes() float64 {
return float64(c / Teraampere)
}
// Petaamperes returns the electric current in PA
func (c ElectricCurrent) Petaamperes() float64 {
return float64(c / Petaampere)
}
// Exaamperes returns the electric current in EA
func (c ElectricCurrent) Exaamperes() float64 {
return float64(c / Exaampere)
}
// Zettaamperes returns the electric current in ZA
func (c ElectricCurrent) Zettaamperes() float64 {
return float64(c / Zettaampere)
}
// Yottaamperes returns the electric current in YA
func (c ElectricCurrent) Yottaamperes() float64 {
return float64(c / Yottaampere)
}