Example #1
0
func ExampleParallax() {
	// Example 47.a, p. 342.
	_, _, Δ := moon.Position(julian.CalendarGregorianToJD(1992, 4, 12))
	π := moon.Parallax(Δ)
	fmt.Printf("π = %.6f\n", π*180/math.Pi)
	// Output:
	// π = 0.991990
}
Example #2
0
func TestPhaseAngleEcl2(t *testing.T) {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	λ, β, _ := moon.Position(j)
	λ0 := solar.ApparentLongitude(base.J2000Century(j))
	i := moonillum.PhaseAngleEcl2(λ, β, λ0)
	k := base.Illuminated(i)
	ref := .6775
	if math.Abs(k-ref) > 1e-4 {
		t.Errorf("k = %.4f", k)
	}
}
Example #3
0
func ExamplePosition() {
	// Example 47.a, p. 342.
	λ, β, Δ := moon.Position(julian.CalendarGregorianToJD(1992, 4, 12))
	fmt.Printf("λ = %.6f\n", λ*180/math.Pi)
	fmt.Printf("β = %.6f\n", β*180/math.Pi)
	fmt.Printf("Δ = %.1f\n", Δ)
	// Output:
	// λ = 133.162655
	// β = -3.229126
	// Δ = 368409.7
}
Example #4
0
func TestPhaseAngleEcl(t *testing.T) {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	λ, β, Δ := moon.Position(j)
	T := base.J2000Century(j)
	λ0 := solar.ApparentLongitude(T)
	R := solar.Radius(T) * base.AU
	i := moonillum.PhaseAngleEcl(λ, β, Δ, λ0, R)
	ref := 69.0756 * math.Pi / 180
	if math.Abs((i-ref)/ref) > 1e-4 {
		t.Errorf("i = %.4f", i*180/math.Pi)
	}
}