func ExampleTopocentric2() { // Example 40.a, p. 280 Δα, Δδ := parallax.Topocentric2( unit.RAFromDeg(339.530208), unit.AngleFromDeg(-15.771083), .37276, .546861, .836339, unit.Angle(unit.NewHourAngle(' ', 7, 47, 27)), julian.CalendarGregorianToJD(2003, 8, 28+ unit.NewTime(' ', 3, 17, 0).Day())) fmt.Printf("Δα = %.2s (sec of RA)\n", sexa.FmtHourAngle(Δα)) fmt.Printf("Δδ = %.1s (sec of Dec)\n", sexa.FmtAngle(Δδ)) // Output: // Δα = 1.29ˢ (sec of RA) // Δδ = -14.1″ (sec of Dec) }
func ExampleTopocentric() { // Example 40.a, p. 280 α, δ := parallax.Topocentric( unit.RAFromDeg(339.530208), unit.AngleFromDeg(-15.771083), .37276, .546861, .836339, unit.Angle(unit.NewHourAngle(' ', 7, 47, 27)), julian.CalendarGregorianToJD(2003, 8, 28+ unit.NewTime(' ', 3, 17, 0).Day())) fmt.Printf("α' = %.2d\n", sexa.FmtRA(α)) fmt.Printf("δ' = %.1d\n", sexa.FmtAngle(δ)) // Output: // α' = 22ʰ38ᵐ8ˢ.54 // δ' = -15°46′30″.0 }
// Test with proper motion of Regulus, with equatorial motions given // in Example 21.a, p. 132, and ecliptic motions given in table 21.A, // p. 138. func TestEqProperMotionToEcl(t *testing.T) { ε := coord.NewObliquity(nutation.MeanObliquity(base.J2000)) mλ, mβ := eqProperMotionToEcl( // eq motions from p. 132. unit.NewHourAngle('-', 0, 0, 0.0169), unit.NewAngle(' ', 0, 0, 0.006), 2000.0, // eq coordinates from p. 132. new(coord.Ecliptic).EqToEcl(&coord.Equatorial{ RA: unit.NewRA(10, 8, 22.3), Dec: unit.NewAngle(' ', 11, 58, 2), }, ε)) d := math.Abs((mλ - unit.AngleFromSec(-.2348)).Rad() / mλ.Rad()) if d*169 > 1 { // 169 = significant digits of given lon t.Fatal("mλ") } d = math.Abs((mβ - unit.AngleFromSec(-.0813)).Rad() / mβ.Rad()) if d*6 > 1 { // 6 = significant digit of given lat t.Fatal("mβ") } }
func ExampleTopocentric3() { // same test case as example 40.a, p. 280 α := unit.RAFromDeg(339.530208) δ := unit.AngleFromDeg(-15.771083) Δ := .37276 ρsφʹ := .546861 ρcφʹ := .836339 L := unit.Angle(unit.NewHourAngle(' ', 7, 47, 27)) jde := julian.CalendarGregorianToJD(2003, 8, 28+ unit.NewTime(' ', 3, 17, 0).Day()) Hʹ, δʹ := parallax.Topocentric3(α, δ, Δ, ρsφʹ, ρcφʹ, L, jde) fmt.Printf("Hʹ = %.2d\n", sexa.FmtHourAngle(Hʹ)) θ0 := sidereal.Apparent(jde) αʹ := unit.RAFromRad(θ0.Rad() - L.Rad() - Hʹ.Rad()) // same result as example 40.a, p. 280 fmt.Printf("αʹ = %.2d\n", sexa.FmtRA(αʹ)) fmt.Printf("δʹ = %.1d\n", sexa.FmtAngle(δʹ)) // Output: // Hʹ = -4ʰ44ᵐ50ˢ.28 // αʹ = 22ʰ38ᵐ8ˢ.54 // δʹ = -15°46′30″.0 }