src

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

anomaly.go (282B)


      1 package sunrise
      2 
      3 import (
      4 	"math"
      5 )
      6 
      7 // SolarMeanAnomaly calculates the angle of the sun relative to the earth for
      8 // the specified Julian day.
      9 func SolarMeanAnomaly(d float64) float64 {
     10 	v := math.Remainder(357.5291+0.98560028*(d-J2000), 360)
     11 	if v < 0 {
     12 		v += 360
     13 	}
     14 	return v
     15 }