- 新增日食、月食、本地可见性、中心线、半影区域、SVG 图示与沙罗周期信息 - 新增行星冲合、留、方照、物理星历、视直径、相位、亮肢角、轨道节点等计算 - 新增木星伽利略卫星位置、现象与接触事件计算 - 新增恒星星表、星座判定、自行修正与观测辅助能力 - 新增 coord、formula、orbit、sundial、lite/sun、lite/moon 等扩展包 - 完善农历年号、月相英文别名、视差角、大气质量、折射、日晷与双星计算 - 增加 NASA、JPL Horizons、IMCCE 等回归测试数据与基线测试 - 重构基础算法文件组织,补充大量公开 API 注释和语义回归测试 - 更新中文和英文 README,补充示例、精度说明、SVG 配图
56 lines
2.2 KiB
Go
56 lines
2.2 KiB
Go
package orbit
|
|
|
|
import (
|
|
"time"
|
|
|
|
"b612.me/astro/basic"
|
|
)
|
|
|
|
// EarthDistance 地心距离 / Earth distance.
|
|
//
|
|
// 返回轨道目标在 date 对应绝对时刻到地球的几何距离,单位 AU。
|
|
// Returns the geometric distance from the orbiting target to Earth at the instant represented by date, in astronomical units.
|
|
func EarthDistance(date time.Time, elements Elements) float64 {
|
|
return basic.OrbitEarthDistance(ttJulianDay(date), toBasicElements(elements))
|
|
}
|
|
|
|
// SunDistance 日心距离 / Sun distance.
|
|
//
|
|
// 返回轨道目标在 date 对应绝对时刻到太阳的几何距离,单位 AU。
|
|
// Returns the geometric distance from the orbiting target to the Sun at the instant represented by date, in astronomical units.
|
|
func SunDistance(date time.Time, elements Elements) float64 {
|
|
return basic.OrbitSunDistance(ttJulianDay(date), toBasicElements(elements))
|
|
}
|
|
|
|
// Elongation 日距角 / elongation.
|
|
//
|
|
// 返回轨道目标与太阳在地心视方向上的角距,单位度。
|
|
// Returns the apparent geocentric angular separation between the target and the Sun, in degrees.
|
|
func Elongation(date time.Time, elements Elements) float64 {
|
|
return basic.OrbitElongation(ttJulianDay(date), toBasicElements(elements))
|
|
}
|
|
|
|
// PhaseAngle 相位角 / phase angle.
|
|
//
|
|
// 返回轨道目标的相位角,单位度。
|
|
// Returns the phase angle of the orbiting target, in degrees.
|
|
func PhaseAngle(date time.Time, elements Elements) float64 {
|
|
return basic.OrbitPhaseAngle(ttJulianDay(date), toBasicElements(elements))
|
|
}
|
|
|
|
// IlluminatedFraction 被照亮比例 / illuminated fraction.
|
|
//
|
|
// 返回轨道目标被太阳照亮的可见比例,范围通常为 [0, 1]。
|
|
// Returns the illuminated fraction of the target, typically in the range [0, 1].
|
|
func IlluminatedFraction(date time.Time, elements Elements) float64 {
|
|
return basic.OrbitIlluminatedFraction(ttJulianDay(date), toBasicElements(elements))
|
|
}
|
|
|
|
// Phase 相位 / phase.
|
|
//
|
|
// 返回轨道目标被照亮比例,是 IlluminatedFraction 的别名。
|
|
// Returns the illuminated fraction of the target and is an alias of IlluminatedFraction.
|
|
func Phase(date time.Time, elements Elements) float64 {
|
|
return IlluminatedFraction(date, elements)
|
|
}
|