func TestNode(t *testing.T) {
	j := julian.CalendarGregorianToJD(2065, 6, 24)
	var e pe.Elements
	pe.Mean(pe.Mercury, j, &e)
	if Ω := pe.Node(pe.Mercury, j); Ω != e.Node {
		t.Fatal(Ω, "!=", e.Node)
	}
}
func TestInc(t *testing.T) {
	j := julian.CalendarGregorianToJD(2065, 6, 24)
	var e pe.Elements
	pe.Mean(pe.Mercury, j, &e)
	if i := pe.Inc(pe.Mercury, j); i != e.Inc {
		t.Fatal(i, "!=", e.Inc)
	}
}
Exemple #3
0
func ExampleEllipticAscending_venus() {
	// Example 39.c, p. 278
	var k planetelements.Elements
	planetelements.Mean(planetelements.Venus,
		julian.CalendarGregorianToJD(1979, 1, 1), &k)
	t, _ := node.EllipticAscending(k.Axis, k.Ecc,
		k.Peri-k.Node,
		perihelion.Perihelion(perihelion.Venus, 1979))
	y, m, d := julian.JDToCalendar(t)
	fmt.Printf("%d %s %.3f\n", y, time.Month(m), d)
	// Output:
	// 1978 November 27.409
}
func ExampleMean() {
	// Example 31.a, p. 211
	j := julian.CalendarGregorianToJD(2065, 6, 24)
	var e pe.Elements
	pe.Mean(pe.Mercury, j, &e)
	fmt.Printf("L: %.6f\n", e.Lon.Deg())
	fmt.Printf("a: %.9f\n", e.Axis)
	fmt.Printf("e: %.8f\n", e.Ecc)
	fmt.Printf("i: %.6f\n", e.Inc.Deg())
	fmt.Printf("Ω: %.6f\n", e.Node.Deg())
	fmt.Printf("ϖ: %.6f\n", e.Peri.Deg())
	// Output:
	// L: 203.494701
	// a: 0.387098310
	// e: 0.20564510
	// i: 7.006171
	// Ω: 49.107650
	// ϖ: 78.475382
}