func ExampleRadius() { // Example 25.a, p. 165. T := base.J2000Century(julian.CalendarGregorianToJD(1992, 10, 13)) fmt.Printf("%.5f AU\n", solar.Radius(T)) // Output: // 0.99766 AU }
func TestPhaseAngleEcl(t *testing.T) { j := julian.CalendarGregorianToJD(1992, 4, 12) λ, β, Δ := moonposition.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) } }