-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathforce.go
44 lines (35 loc) · 840 Bytes
/
force.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 unit
// Force represents a SI unit of force (in newtons, N)
type Force Unit
// ...
const (
// SI
Newton Force = 1e0
// non-SI
Dyne = Newton * 1e-5
KilogramForce = Newton * 9.80665
PoundForce = Newton * 4.448222
Poundal = Newton * 0.138255
// aliases
Kilopond = KilogramForce
)
// Newtons returns the force in N
func (f Force) Newtons() float64 {
return float64(f)
}
// Dynes returns the force in dyn
func (f Force) Dynes() float64 {
return float64(f / Dyne)
}
// KilogramForce returns the force in kp
func (f Force) KilogramForce() float64 {
return float64(f / KilogramForce)
}
// PoundForce returns the force in lbf
func (f Force) PoundForce() float64 {
return float64(f / PoundForce)
}
// Poundals returns the force in pdl
func (f Force) Poundals() float64 {
return float64(f / Poundal)
}