func ExampleMean_b() { // Example 12.b, p. 89. jd := julian.TimeToJD(time.Date(1987, 4, 10, 19, 21, 0, 0, time.UTC)) fmt.Printf("%.4d\n", sexa.NewFmtTime(sidereal.Mean(jd))) // Output: // 8ʰ34ᵐ57ˢ.0896 }
func ExamplePoly1900to1997() { // Example 10.a, p. 78. jd := julian.TimeToJD(time.Date(1977, 2, 18, 3, 37, 40, 0, time.UTC)) year := base.JDEToJulianYear(jd) fmt.Printf("julian year %.1f\n", year) fmt.Printf("%+.1f seconds\n", deltat.Poly1900to1997(jd)) // Output: // julian year 1977.1 // +47.1 seconds }
func ExampleHorizontal_EqToHz() { // Example 13.b, p. 95. eq := &coord.Equatorial{ RA: unit.NewRA(23, 9, 16.641), Dec: unit.NewAngle('-', 6, 43, 11.61), } g := &globe.Coord{ Lat: unit.NewAngle(' ', 38, 55, 17), Lon: unit.NewAngle(' ', 77, 3, 56), } jd := julian.TimeToJD(time.Date(1987, 4, 10, 19, 21, 0, 0, time.UTC)) st := sidereal.Apparent(jd) hz := new(coord.Horizontal).EqToHz(eq, g, st) fmt.Printf("A = %+.3j\n", sexa.FmtAngle(hz.Az)) fmt.Printf("h = %+.3j\n", sexa.FmtAngle(hz.Alt)) // Output: // A = +68°.034 // h = +15°.125 }
func ExampleHorizontal_EqToHz() { // Example 13.b, p. 95. eq := &coord.Equatorial{ RA: sexa.NewRA(23, 9, 16.641).Rad(), Dec: sexa.NewAngle(true, 6, 43, 11.61).Rad(), } g := &globe.Coord{ Lat: sexa.NewAngle(false, 38, 55, 17).Rad(), Lon: sexa.NewAngle(false, 77, 3, 56).Rad(), } jd := julian.TimeToJD(time.Date(1987, 4, 10, 19, 21, 0, 0, time.UTC)) st := sidereal.Apparent(jd) hz := new(coord.Horizontal).EqToHz(eq, g, st) AStr := fmt.Sprintf("%+.3j", sexa.NewFmtAngle(hz.Az)) hStr := fmt.Sprintf("%+.3j", sexa.NewFmtAngle(hz.Alt)) fmt.Println("A =", AStr) fmt.Println("h =", hStr) // Output: // A = +68°.034 // h = +15°.125 }