You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
astro/basic/all_test.go

40 lines
1.3 KiB
Go

5 years ago
package basic
import (
"fmt"
"testing"
)
func Test_All(t *testing.T) {
show()
}
func Benchmark_All(b *testing.B) {
for i := 0; i < b.N; i++ {
show()
}
}
func show() {
5 years ago
jde := GetNowJDE() - 1
ra := HSunApparentRa(jde - 8.0/24.0)
dec := HSunApparentDec(jde - 8.0/24.0)
5 years ago
fmt.Printf("当前JDE:%.14f\n", jde)
fmt.Println("当前太阳黄经:", HSunApparentLo(jde-8.0/24.0))
5 years ago
fmt.Println("当前太阳赤经:", ra)
fmt.Println("当前太阳赤纬:", dec)
fmt.Println("当前太阳星座:", WhichCst(ra, dec, jde))
fmt.Println("当前黄赤交角:", EclipticObliquity(jde-8.0/24.0, true))
fmt.Println("当前日出:", JDE2Date(GetSunRiseTime(jde, 115, 32, 8, 1, 10)))
fmt.Println("当前日落:", JDE2Date(GetSunDownTime(jde, 115, 32, 8, 1, 10)))
5 years ago
fmt.Println("当前晨影 -6", JDE2Date(GetAsaTime(jde, 115, 32, 8, -6)))
fmt.Println("当前晨影 -12", JDE2Date(GetAsaTime(jde, 115, 32, 8, -12)))
fmt.Println("当前昏影 -6", JDE2Date(GetBanTime(jde, 115, 32, 8, -6)))
fmt.Println("当前昏影 -12", JDE2Date(GetBanTime(jde, 115, 32, 8, -12)))
fmt.Print("农历:")
3 years ago
fmt.Println(GetLunar(2019, 10, 23, 8.0/24.0))
fmt.Println("当前月出:", JDE2Date(GetMoonRiseTime(jde, 115, 32, 8, 1, 10)))
fmt.Println("当前月落:", JDE2Date(GetMoonDownTime(jde, 115, 32, 8, 1, 10)))
5 years ago
fmt.Println("月相:", MoonLight(jde-8.0/24.0))
}