improve rise/down calc
This commit is contained in:
@@ -86,6 +86,9 @@ func DownTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, e
|
||||
// angle,朦影角度:可选-6 -12 -18(民用、航海、天文)
|
||||
func MorningTwilight(date time.Time, lon, lat, angle float64) (time.Time, error) {
|
||||
var err error
|
||||
if date.Hour() > 12 {
|
||||
date = date.Add(time.Hour * -12)
|
||||
}
|
||||
jde := basic.Date2JDE(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
@@ -106,6 +109,9 @@ func MorningTwilight(date time.Time, lon, lat, angle float64) (time.Time, error)
|
||||
// angle,朦影角度:可选-6 -12 -18(民用、航海、天文)
|
||||
func EveningTwilight(date time.Time, lon, lat, angle float64) (time.Time, error) {
|
||||
var err error
|
||||
if date.Hour() > 12 {
|
||||
date = date.Add(time.Hour * -12)
|
||||
}
|
||||
jde := basic.Date2JDE(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
|
||||
Reference in New Issue
Block a user