improve rise/down calc

This commit is contained in:
2022-05-10 22:24:10 +08:00
parent c5f34d3ab8
commit 7604fabf8f
8 changed files with 276 additions and 82 deletions
+37
View File
@@ -66,3 +66,40 @@ func Test_SunRise(t *testing.T) {
fmt.Println(JDE2Date((b)))
fmt.Println(time.Now().UnixNano() - a)
}
func Test_SunTwilightMo(t *testing.T) {
cst := time.FixedZone("cst", 8*3600)
jde := Date2JDE(time.Date(2023, 10, 3, 15, 59, 0, 0, cst))
fmt.Println(GetAsaTime(jde, 113.58880556, 87.66833333, 8, -6))
for i := 10.0; i < 90.0; i += 0.3 {
fmt.Println(i, GetAsaTime(jde, 113.5880556, float64(i), 8, -6))
}
}
func Test_SunTwilightEv(t *testing.T) {
cst := time.FixedZone("cst", 8*3600)
jde := Date2JDE(time.Date(2023, 10, 3, 15, 59, 0, 0, cst))
for i := 10.0; i < 90.0; i += 0.3 {
fmt.Println(i, GetBanTime(jde, 115, float64(i), 8, -18))
}
}
func Test_SunRiseRound(t *testing.T) {
jde := GetNowJDE()
for i := 10.0; i < 90.0; i += 0.3 {
fmt.Println(i, GetSunRiseTime(jde, 115, float64(i), 8, 0, 0))
}
}
func Test_SunDown(t *testing.T) {
jde := GetNowJDE()
for i := 10.0; i < 90.0; i += 0.3 {
fmt.Println(i, GetSunDownTime(jde, 115, float64(i), 8, 0, 0))
}
}
func Test_SunAz(t *testing.T) {
cst := time.FixedZone("cst", 8*3600)
fmt.Println(SunAngle(Date2JDE(time.Date(2022, 5, 30, 11, 55, 0, 0, cst)),
120, 30, 8.0))
}