Beispiel #1
0
func ExampleIlluminated_moon() {
	// Example 48.a, p. 347.
	k := base.Illuminated(69.0756 * math.Pi / 180)
	fmt.Printf("k = %.4f\n", k)
	// Output:
	// k = 0.6786
}
Beispiel #2
0
func ExampleIlluminated_venus() {
	// Example 41.a, p. 284.
	k := base.Illuminated(math.Acos(.29312))
	fmt.Printf("%.3f\n", k)
	// Output:
	// 0.647
}
Beispiel #3
0
func ExampleIlluminated_moon() {
	// Example 48.a, p. 347.
	k := base.Illuminated(unit.AngleFromDeg(69.0756))
	fmt.Printf("k = %.4f\n", k)
	// Output:
	// k = 0.6786
}
Beispiel #4
0
func ExamplePhaseAngleEq2() {
	const p = math.Pi / 180
	i := moonillum.PhaseAngleEq2(134.6885*p, 13.7684*p, 20.6579*p, 8.6964*p)
	k := base.Illuminated(i)
	fmt.Printf("k = %.4f\n", k)
	// Output:
	// k = 0.6775
}
Beispiel #5
0
func ExamplePhaseAngle3() {
	i := moonillum.PhaseAngle3(julian.CalendarGregorianToJD(1992, 4, 12))
	k := base.Illuminated(i)
	fmt.Printf("i = %.2f\n", i*180/math.Pi)
	fmt.Printf("k = %.4f\n", k)
	// Output:
	// i = 68.88
	// k = 0.6801
}
Beispiel #6
0
func TestPhaseAngleEcl2(t *testing.T) {
	j := julian.CalendarGregorianToJD(1992, 4, 12)
	λ, β, _ := moonposition.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)
	}
}
Beispiel #7
0
func ExamplePhaseAngleEq2() {
	i := moonillum.PhaseAngleEq2(
		unit.RAFromDeg(134.6885),
		unit.AngleFromDeg(13.7684),
		unit.RAFromDeg(20.6579),
		unit.AngleFromDeg(8.6964))
	k := base.Illuminated(i)
	fmt.Printf("k = %.4f\n", k)
	// Output:
	// k = 0.6775
}