Added Atan2{,32}.
This commit is contained in:
parent
a7a4688687
commit
701ba39cdc
10
math.go
10
math.go
@ -24,11 +24,21 @@ func Atan(f float64) float64 {
|
|||||||
return math.Atan(f)
|
return math.Atan(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Atan2 returns the arc tangent of y/x.
|
||||||
|
func Atan2(y, x float64) float64 {
|
||||||
|
return math.Atan2(y, x)
|
||||||
|
}
|
||||||
|
|
||||||
// Atan32 returns the arc tangent of f.
|
// Atan32 returns the arc tangent of f.
|
||||||
func Atan32(f float32) float32 {
|
func Atan32(f float32) float32 {
|
||||||
return float32(math.Atan(float64(f)))
|
return float32(math.Atan(float64(f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Atan232 returns the arc tangent of y/x.
|
||||||
|
func Atan232(y, x float32) float32 {
|
||||||
|
return float32(math.Atan2(float64(y), float64(x)))
|
||||||
|
}
|
||||||
|
|
||||||
// Ceil rounds f up to an natural number.
|
// Ceil rounds f up to an natural number.
|
||||||
func Ceil(f float64) float64 {
|
func Ceil(f float64) float64 {
|
||||||
return math.Ceil(f)
|
return math.Ceil(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user