feat: 完善时标与天象几何计算并扩展输出接口
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
This commit is contained in:
+74
-79
@@ -15,7 +15,7 @@ var (
|
||||
ERR_MERCURY_NEVER_DOWN = ERR_MERCURY_NEVER_SET
|
||||
)
|
||||
|
||||
func riseSetResult(date time.Time, jde float64, err error) (time.Time, error) {
|
||||
func riseSetResult(date time.Time, jd float64, err error) (time.Time, error) {
|
||||
if err != nil {
|
||||
switch {
|
||||
case errors.Is(err, basic.ErrNeverRise):
|
||||
@@ -26,7 +26,8 @@ func riseSetResult(date time.Time, jde float64, err error) (time.Time, error) {
|
||||
return time.Time{}, err
|
||||
}
|
||||
}
|
||||
return basic.JDE2DateByZone(jde, date.Location(), true), nil
|
||||
_, offset := date.Zone()
|
||||
return basic.JD2DateByZone(jd-float64(offset)/86400, date.Location(), false), nil
|
||||
}
|
||||
|
||||
// ApparentLo 视黄经 / apparent ecliptic longitude.
|
||||
@@ -34,8 +35,8 @@ func riseSetResult(date time.Time, jde float64, err error) (time.Time, error) {
|
||||
// 返回水星在 date 对应绝对时刻的瞬时视黄经,单位度。
|
||||
// Returns the apparent ecliptic longitude of Mercury at the instant represented by date, in degrees.
|
||||
func ApparentLo(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryApparentLo(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryApparentLo(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// ApparentBo 视黄纬 / apparent ecliptic latitude.
|
||||
@@ -43,8 +44,8 @@ func ApparentLo(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻的瞬时视黄纬,单位度。
|
||||
// Returns the apparent ecliptic latitude of Mercury at the instant represented by date, in degrees.
|
||||
func ApparentBo(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryApparentBo(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryApparentBo(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// ApparentRa 视赤经 / apparent right ascension.
|
||||
@@ -52,8 +53,8 @@ func ApparentBo(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻的瞬时视赤经,单位度。
|
||||
// Returns the apparent right ascension of Mercury at the instant represented by date, in degrees.
|
||||
func ApparentRa(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryApparentRa(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryApparentRa(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// ApparentDec 视赤纬 / apparent declination.
|
||||
@@ -61,8 +62,8 @@ func ApparentRa(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻的瞬时视赤纬,单位度。
|
||||
// Returns the apparent declination of Mercury at the instant represented by date, in degrees.
|
||||
func ApparentDec(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryApparentDec(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryApparentDec(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// ApparentRaDec 视赤经、视赤纬 / apparent right ascension and declination.
|
||||
@@ -70,8 +71,8 @@ func ApparentDec(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻的瞬时视赤经与视赤纬,单位度。
|
||||
// Returns the apparent right ascension and declination of Mercury at the instant represented by date, in degrees.
|
||||
func ApparentRaDec(date time.Time) (float64, float64) {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryApparentRaDec(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryApparentRaDec(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// ApparentMagnitude 视星等 / apparent magnitude.
|
||||
@@ -79,8 +80,8 @@ func ApparentRaDec(date time.Time) (float64, float64) {
|
||||
// 返回水星在 date 对应绝对时刻的视星等。
|
||||
// Returns the apparent visual magnitude of Mercury at the instant represented by date.
|
||||
func ApparentMagnitude(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.MercuryMag(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.MercuryMag(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// EarthDistance 地心距离 / Earth distance.
|
||||
@@ -88,8 +89,8 @@ func ApparentMagnitude(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻到地球的距离,单位 AU。
|
||||
// Returns the distance from Mercury to Earth at the instant represented by date, in astronomical units.
|
||||
func EarthDistance(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return basic.EarthMercuryAway(basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return basic.EarthMercuryAway(basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// SunDistance 日心距离 / Sun distance.
|
||||
@@ -97,8 +98,8 @@ func EarthDistance(date time.Time) float64 {
|
||||
// 返回水星在 date 对应绝对时刻到太阳的距离,单位 AU。
|
||||
// Returns the distance from Mercury to the Sun at the instant represented by date, in astronomical units.
|
||||
func SunDistance(date time.Time) float64 {
|
||||
jde := calendar.Date2JDE(date.UTC())
|
||||
return planet.WherePlanet(1, 2, basic.TD2UT(jde, true))
|
||||
jd := calendar.Date2JD(date.UTC())
|
||||
return planet.WherePlanet(1, 2, basic.UTC2TT(jd))
|
||||
}
|
||||
|
||||
// Altitude 高度角 / altitude.
|
||||
@@ -106,10 +107,10 @@ func SunDistance(date time.Time) float64 {
|
||||
// date 表示观测时刻,会读取其时区参与地方时计算;lon 为观测者经度,东正西负;lat 为观测者纬度,北正南负。返回值单位度。
|
||||
// date is the observing instant and its zone offset participates in local-time calculations. lon is east-positive longitude, lat is north-positive latitude, and the result is in degrees.
|
||||
func Altitude(date time.Time, lon, lat float64) float64 {
|
||||
jde := basic.Date2JDE(date)
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
return basic.MercuryHeight(jde, lon, lat, timezone)
|
||||
return basic.MercuryHeight(localJD, lon, lat, timezone)
|
||||
}
|
||||
|
||||
// Zenith 天顶距 / zenith distance.
|
||||
@@ -125,10 +126,10 @@ func Zenith(date time.Time, lon, lat float64) float64 {
|
||||
// date 表示观测时刻,会读取其时区参与地方时计算;lon 为观测者经度,东正西负;lat 为观测者纬度,北正南负。返回值按正北为 0°、向东增加。
|
||||
// date is the observing instant and its zone offset participates in local-time calculations. lon is east-positive longitude, lat is north-positive latitude, and azimuth is measured from north toward east.
|
||||
func Azimuth(date time.Time, lon, lat float64) float64 {
|
||||
jde := basic.Date2JDE(date)
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
return basic.MercuryAzimuth(jde, lon, lat, timezone)
|
||||
return basic.MercuryAzimuth(localJD, lon, lat, timezone)
|
||||
}
|
||||
|
||||
// HourAngle 时角 / hour angle.
|
||||
@@ -136,10 +137,10 @@ func Azimuth(date time.Time, lon, lat float64) float64 {
|
||||
// date 表示观测时刻,会读取其时区参与地方时计算;lon 为观测者经度,东正西负。返回值单位度。
|
||||
// date is the observing instant and its zone offset participates in local-time calculations. lon is east-positive longitude and the returned hour angle is in degrees.
|
||||
func HourAngle(date time.Time, lon float64) float64 {
|
||||
jde := basic.Date2JDE(date)
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
return basic.MercuryHourAngle(jde, lon, timezone)
|
||||
return basic.MercuryHourAngle(localJD, lon, timezone)
|
||||
}
|
||||
|
||||
// CulminationTime 中天时刻 / culmination time.
|
||||
@@ -147,33 +148,29 @@ func HourAngle(date time.Time, lon float64) float64 {
|
||||
// date 取其所在时区的当地日期,返回值保持相同时区;lon 为观测者经度,东正西负。
|
||||
// date is interpreted on its local civil day and the result keeps the same time zone. lon is east-positive longitude.
|
||||
func CulminationTime(date time.Time, lon float64) time.Time {
|
||||
if date.Hour() > 12 {
|
||||
date = date.Add(time.Hour * -12)
|
||||
}
|
||||
jde := basic.Date2JDE(date)
|
||||
date = time.Date(date.Year(), date.Month(), date.Day(), 0, 0, 0, 0, date.Location())
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
calcJde := basic.MercuryCulminationTime(jde, lon, timezone) - timezone/24.00
|
||||
return basic.JDE2DateByZone(calcJde, date.Location(), false)
|
||||
calcJD := basic.MercuryCulminationTime(localJD, lon, timezone) - timezone/24.00
|
||||
return basic.JD2DateByZone(calcJD, date.Location(), false)
|
||||
}
|
||||
|
||||
// RiseTime 升起时间 / rise time.
|
||||
//
|
||||
// date 取其所在时区的当地日期,返回值保持相同时区;lon 为东正西负经度,lat 为北正南负纬度;height 为观测点海拔高度(米);aero 为 true 时加入标准大气折射。
|
||||
// date 取其所在时区的当地日期,返回值保持相同时区;lon 为东正西负经度,lat 为北正南负纬度;height 为观测点椭球高(大地高,米);aero 为 true 时加入标准大气折射。
|
||||
// date is interpreted on its local civil day and the result keeps the same time zone. lon is east-positive longitude, lat is north-positive latitude, height is observer elevation in meters, and aero enables standard atmospheric refraction.
|
||||
func RiseTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, error) {
|
||||
var aeroFloat float64
|
||||
if aero {
|
||||
aeroFloat = 1
|
||||
}
|
||||
if date.Hour() > 12 {
|
||||
date = date.Add(time.Hour * -12)
|
||||
}
|
||||
jde := basic.Date2JDE(date)
|
||||
date = time.Date(date.Year(), date.Month(), date.Day(), 0, 0, 0, 0, date.Location())
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
riseJde, err := basic.MercuryRiseTime(jde, lon, lat, timezone, aeroFloat, height)
|
||||
return riseSetResult(date, riseJde, err)
|
||||
riseJD, err := basic.MercuryRiseTime(localJD, lon, lat, timezone, aeroFloat, height)
|
||||
return riseSetResult(date, riseJD, err)
|
||||
}
|
||||
|
||||
// DownTime 落下时间别名 / deprecated set-time alias.
|
||||
@@ -195,14 +192,12 @@ func SetTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, er
|
||||
if aero {
|
||||
aeroFloat = 1
|
||||
}
|
||||
if date.Hour() > 12 {
|
||||
date = date.Add(time.Hour * -12)
|
||||
}
|
||||
jde := basic.Date2JDE(date)
|
||||
date = time.Date(date.Year(), date.Month(), date.Day(), 0, 0, 0, 0, date.Location())
|
||||
localJD := basic.Date2JD(date)
|
||||
_, loc := date.Zone()
|
||||
timezone := float64(loc) / 3600.0
|
||||
riseJde, err := basic.MercurySetTime(jde, lon, lat, timezone, aeroFloat, height)
|
||||
return riseSetResult(date, riseJde, err)
|
||||
riseJD, err := basic.MercurySetTime(localJD, lon, lat, timezone, aeroFloat, height)
|
||||
return riseSetResult(date, riseJD, err)
|
||||
}
|
||||
|
||||
// LastConjunction 上一次合日 / previous conjunction with the Sun.
|
||||
@@ -210,8 +205,8 @@ func SetTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, er
|
||||
// 返回 date 当前或之前最近一次与太阳的合日时刻,结果保持 date 的时区。
|
||||
// Returns the nearest conjunction with the Sun at or before date, keeping date's time zone.
|
||||
func LastConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryConjunction(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryConjunction(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextConjunction 下一次合日 / next conjunction with the Sun.
|
||||
@@ -219,8 +214,8 @@ func LastConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次与太阳的合日时刻,结果保持 date 的时区。
|
||||
// Returns the nearest conjunction with the Sun at or after date, keeping date's time zone.
|
||||
func NextConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryConjunction(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryConjunction(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastInferiorConjunction 上一次下合 / previous inferior conjunction.
|
||||
@@ -228,8 +223,8 @@ func NextConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次下合时刻,结果保持 date 的时区。
|
||||
// Returns the nearest inferior conjunction at or before date, keeping date's time zone.
|
||||
func LastInferiorConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryInferiorConjunctionInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryInferiorConjunctionInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextInferiorConjunction 下一次下合 / next inferior conjunction.
|
||||
@@ -237,8 +232,8 @@ func LastInferiorConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次下合时刻,结果保持 date 的时区。
|
||||
// Returns the nearest inferior conjunction at or after date, keeping date's time zone.
|
||||
func NextInferiorConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryInferiorConjunctionInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryInferiorConjunctionInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastSuperiorConjunction 上一次上合 / previous superior conjunction.
|
||||
@@ -246,8 +241,8 @@ func NextInferiorConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次上合时刻,结果保持 date 的时区。
|
||||
// Returns the nearest superior conjunction at or before date, keeping date's time zone.
|
||||
func LastSuperiorConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercurySuperiorConjunctionInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercurySuperiorConjunctionInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextSuperiorConjunction 下一次上合 / next superior conjunction.
|
||||
@@ -255,8 +250,8 @@ func LastSuperiorConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次上合时刻,结果保持 date 的时区。
|
||||
// Returns the nearest superior conjunction at or after date, keeping date's time zone.
|
||||
func NextSuperiorConjunction(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercurySuperiorConjunctionInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercurySuperiorConjunctionInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastRetrograde 上一次留 / previous stationary point.
|
||||
@@ -264,8 +259,8 @@ func NextSuperiorConjunction(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次留时刻,不区分顺转逆还是逆转顺,结果保持 date 的时区。
|
||||
// Returns the nearest stationary point at or before date, regardless of the direction change, keeping date's time zone.
|
||||
func LastRetrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryRetrogradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryRetrogradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextRetrograde 下一次留 / next stationary point.
|
||||
@@ -273,8 +268,8 @@ func LastRetrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次留时刻,不区分顺转逆还是逆转顺,结果保持 date 的时区。
|
||||
// Returns the nearest stationary point at or after date, regardless of the direction change, keeping date's time zone.
|
||||
func NextRetrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryRetrogradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryRetrogradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastProgradeToRetrograde 上一次顺行转逆行留 / previous station from prograde to retrograde.
|
||||
@@ -282,8 +277,8 @@ func NextRetrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次由顺行转为逆行的留时刻,结果保持 date 的时区。
|
||||
// Returns the nearest station at or before date where motion changes from prograde to retrograde, keeping date's time zone.
|
||||
func LastProgradeToRetrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryProgradeToRetrogradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryProgradeToRetrogradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextProgradeToRetrograde 下一次顺行转逆行留 / next station from prograde to retrograde.
|
||||
@@ -291,8 +286,8 @@ func LastProgradeToRetrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次由顺行转为逆行的留时刻,结果保持 date 的时区。
|
||||
// Returns the nearest station at or after date where motion changes from prograde to retrograde, keeping date's time zone.
|
||||
func NextProgradeToRetrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryProgradeToRetrogradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryProgradeToRetrogradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastRetrogradeToPrograde 上一次逆行转顺行留 / previous station from retrograde to prograde.
|
||||
@@ -300,8 +295,8 @@ func NextProgradeToRetrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次由逆行转为顺行的留时刻,结果保持 date 的时区。
|
||||
// Returns the nearest station at or before date where motion changes from retrograde to prograde, keeping date's time zone.
|
||||
func LastRetrogradeToPrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryRetrogradeToProgradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryRetrogradeToProgradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextRetrogradeToPrograde 下一次逆行转顺行留 / next station from retrograde to prograde.
|
||||
@@ -309,8 +304,8 @@ func LastRetrogradeToPrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次由逆行转为顺行的留时刻,结果保持 date 的时区。
|
||||
// Returns the nearest station at or after date where motion changes from retrograde to prograde, keeping date's time zone.
|
||||
func NextRetrogradeToPrograde(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryRetrogradeToProgradeInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryRetrogradeToProgradeInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastGreatestElongation 上一次大距 / previous greatest elongation.
|
||||
@@ -318,8 +313,8 @@ func NextRetrogradeToPrograde(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次大距时刻,不区分东西大距,结果保持 date 的时区。
|
||||
// Returns the nearest greatest elongation at or before date, regardless of east or west, keeping date's time zone.
|
||||
func LastGreatestElongation(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryGreatestElongationInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryGreatestElongationInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextGreatestElongation 下一次大距 / next greatest elongation.
|
||||
@@ -327,8 +322,8 @@ func LastGreatestElongation(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次大距时刻,不区分东西大距,结果保持 date 的时区。
|
||||
// Returns the nearest greatest elongation at or after date, regardless of east or west, keeping date's time zone.
|
||||
func NextGreatestElongation(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryGreatestElongationInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryGreatestElongationInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastGreatestElongationEast 上一次东大距 / previous greatest eastern elongation.
|
||||
@@ -336,8 +331,8 @@ func NextGreatestElongation(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次东大距时刻,结果保持 date 的时区。
|
||||
// Returns the nearest eastern greatest elongation at or before date, keeping date's time zone.
|
||||
func LastGreatestElongationEast(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryGreatestElongationEastInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryGreatestElongationEastInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextGreatestElongationEast 下一次东大距 / next greatest eastern elongation.
|
||||
@@ -345,8 +340,8 @@ func LastGreatestElongationEast(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次东大距时刻,结果保持 date 的时区。
|
||||
// Returns the nearest eastern greatest elongation at or after date, keeping date's time zone.
|
||||
func NextGreatestElongationEast(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryGreatestElongationEastInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryGreatestElongationEastInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// LastGreatestElongationWest 上一次西大距 / previous greatest western elongation.
|
||||
@@ -354,8 +349,8 @@ func NextGreatestElongationEast(date time.Time) time.Time {
|
||||
// 返回 date 当前或之前最近一次西大距时刻,结果保持 date 的时区。
|
||||
// Returns the nearest western greatest elongation at or before date, keeping date's time zone.
|
||||
func LastGreatestElongationWest(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.LastMercuryGreatestElongationWestInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.LastMercuryGreatestElongationWestInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
// NextGreatestElongationWest 下一次西大距 / next greatest western elongation.
|
||||
@@ -363,6 +358,6 @@ func LastGreatestElongationWest(date time.Time) time.Time {
|
||||
// 返回 date 当前或之后最近一次西大距时刻,结果保持 date 的时区。
|
||||
// Returns the nearest western greatest elongation at or after date, keeping date's time zone.
|
||||
func NextGreatestElongationWest(date time.Time) time.Time {
|
||||
jde := basic.TD2UT(basic.Date2JDE(date.UTC()), true)
|
||||
return basic.JDE2DateByZone(basic.NextMercuryGreatestElongationWestInclusive(jde), date.Location(), false)
|
||||
jde := basic.UTC2TT(basic.Date2JD(date.UTC()))
|
||||
return basic.JD2DateByZone(basic.NextMercuryGreatestElongationWestInclusive(jde), date.Location(), false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user