src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

noon.go (346B)


      1 package sunrise
      2 
      3 import (
      4 	"time"
      5 )
      6 
      7 // MeanSolarNoon calculates the time at which the sun is at its highest
      8 // altitude. The returned time is in Julian days.
      9 func MeanSolarNoon(longitude float64, year int, month time.Month, day int) float64 {
     10 	t := time.Date(year, month, day, 12, 0, 0, 0, time.UTC)
     11 	return TimeToJulianDay(t) - longitude/360
     12 }