Exemple #1
0
func ExampleAphelion() {
	// Example 38.b, p. 270
	j := pa.Aphelion(pa.Mars, 2032.5)
	fmt.Printf("%.3f\n", j)
	y, m, df := julian.JDToCalendar(j)
	d, f := math.Modf(df)
	fmt.Printf("%d %s %d at %dʰ\n", y, time.Month(m), int(d), int(f*24+.5))
	// Output:
	// 2463530.456
	// 2032 October 24 at 23ʰ
}
Exemple #2
0
func TestJS(t *testing.T) {
	// p. 270
	j := pa.Aphelion(pa.Jupiter, 1981.5)
	y, m, d := julian.JDToCalendar(j)
	if y != 1981 || m != 7 || int(d) != 19 {
		t.Fatal(y, m, d)
	}
	s := pa.Perihelion(pa.Saturn, 1944.5)
	y, m, d = julian.JDToCalendar(s)
	if y != 1944 || m != 7 || int(d) != 30 {
		t.Fatal(y, m, d)
	}
}