示例#1
0
文件: pp_test.go 项目: thecc4re/meeus
func ExampleSunAltitude() {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	_, _, _, l0, b0 := moon.Physical(j, earth)
	h := moon.SunAltitude(-20*math.Pi/180, 9.7*math.Pi/180, l0, b0)
	fmt.Printf("%+.3f\n", h*180/math.Pi)
	// Output:
	// +2.318
}
示例#2
0
func ExampleSunAltitude() {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	earth, err := pp.LoadPlanet(pp.Earth)
	if err != nil {
		fmt.Println(err)
		return
	}
	_, _, _, l0, b0 := moon.Physical(j, earth)
	h := moon.SunAltitude(
		unit.AngleFromDeg(-20), unit.AngleFromDeg(9.7), l0, b0)
	fmt.Printf("%+.3f\n", h.Deg())
	// Output:
	// +2.318
}