16c62a97d5
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
33 lines
834 B
Go
33 lines
834 B
Go
package earth
|
|
|
|
import (
|
|
"time"
|
|
|
|
"b612.me/astro/basic"
|
|
)
|
|
|
|
// ApsisInfo 轨道极值事件 / orbital distance extremum event.
|
|
type ApsisInfo struct {
|
|
// Time 事件时刻,UTC / event time in UTC.
|
|
Time time.Time
|
|
// Distance 极值距离,单位 AU / extremum distance in AU.
|
|
Distance float64
|
|
}
|
|
|
|
// Perihelion 指定年份的地球近日点 / Earth perihelion in the given year.
|
|
func Perihelion(year int) ApsisInfo {
|
|
return convertEarthApsisInfo(basic.EarthPerihelion(year))
|
|
}
|
|
|
|
// Aphelion 指定年份的地球远日点 / Earth aphelion in the given year.
|
|
func Aphelion(year int) ApsisInfo {
|
|
return convertEarthApsisInfo(basic.EarthAphelion(year))
|
|
}
|
|
|
|
func convertEarthApsisInfo(event basic.ApsisEvent) ApsisInfo {
|
|
return ApsisInfo{
|
|
Time: basic.JD2DateByZone(event.JD, time.UTC, false),
|
|
Distance: event.Distance,
|
|
}
|
|
}
|