func Interp10A(jde float64) float64 { // kind of crazy, working in calendar years, but it seems that's what // we're supposed to do. y, m, d := julian.JDToCalendar(jde) l := julian.LeapYearGregorian(y) yl := 365. if l { yl++ } yf := float64(y) + float64(julian.DayOfYear(y, m, int(d+.5), l))/yl d3, err := interp.Len3ForInterpolateX(yf, tableYear1, tableYearN, table10A) if err != nil { panic(err) // error would indicate a bug in interp.Slice. } return d3.InterpolateX(yf) }
func ExampleDayOfYear_g() { // Example 7.g, p. 65. fmt.Println(julian.DayOfYear(1988, 4, 22, true)) // Output: // 113 }
func ExampleDayOfYear_f() { // Example 7.f, p. 65. fmt.Println(julian.DayOfYear(1978, 11, 14, false)) // Output: // 318 }