fixed dependencies

This commit is contained in:
nuknal
2024-10-24 15:46:01 +08:00
parent d16a5bd9c0
commit 1161e8d054
2005 changed files with 690883 additions and 0 deletions

24
vendor/github.com/starainrt/astro/tools/format.go generated vendored Normal file
View File

@@ -0,0 +1,24 @@
package tools
import (
"fmt"
"math"
)
func Format(val float64, typed uint8) string {
belowZero := false
if val < 0 {
belowZero = true
val = -val
}
degree := math.Floor(val)
min := math.Floor((val - degree) * 60)
sec := (val - degree - min/60) * 3600
if belowZero {
degree = -degree
}
if typed == 0 {
return fmt.Sprintf("%.0f°%.0f%.2f″", degree, min, sec)
}
return fmt.Sprintf("%.0fh%.0fm%.2fs", degree, min, sec)
}

53
vendor/github.com/starainrt/astro/tools/math.go generated vendored Normal file
View File

@@ -0,0 +1,53 @@
package tools
import (
"math"
)
func Sin(x float64) float64 {
return (math.Sin(x * math.Pi / 180.00000))
}
func Cos(x float64) float64 {
return (math.Cos(x * math.Pi / 180.00000))
}
func Tan(x float64) float64 {
return (math.Tan(x * math.Pi / 180.00000))
}
func ArcSin(x float64) float64 {
return (math.Asin(x) / math.Pi * 180.00000)
}
func ArcCos(x float64) float64 {
return (math.Acos(x) / math.Pi * 180.00000)
}
func ArcTan(x float64) float64 {
return (math.Atan(x) / math.Pi * 180.00000)
}
func FloatRound(f float64, n int) float64 {
p := math.Pow10(n)
return math.Floor(f*p+0.5) / p
}
func Limit360(x float64) float64 {
x = math.Mod(x, 360)
if x < 0 {
x += 360
}
return x
}
func FR(f float64) float64 {
return FloatRound(f, 14)
}
func Abs(x int) int {
if x < 0 {
return -x
}
return x
}