feat: 完善时标与天象几何计算并扩展输出接口
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
This commit is contained in:
@@ -57,8 +57,8 @@ func OrbitEccentricAnomaly(jd float64, elements OrbitElements) float64 {
|
||||
}
|
||||
|
||||
// OrbitTrueAnomaly 返回给定 TT/TDB 儒略日的真近点角,单位度。
|
||||
func OrbitTrueAnomaly(jd float64, elements OrbitElements) float64 {
|
||||
trueAnomaly, _, _, ok := orbitTrueAnomalyAndRadius(jd, elements)
|
||||
func OrbitTrueAnomaly(jde float64, elements OrbitElements) float64 {
|
||||
trueAnomaly, _, _, ok := orbitTrueAnomalyAndRadius(jde, elements)
|
||||
if !ok {
|
||||
return math.NaN()
|
||||
}
|
||||
@@ -149,25 +149,25 @@ func orbitHyperbolicAnomaly(meanAnomaly, eccentricity float64) (float64, bool) {
|
||||
return hyperbolicAnomaly, true
|
||||
}
|
||||
|
||||
func orbitTrueAnomalyAndRadius(jd float64, elements OrbitElements) (trueAnomaly, radius float64, resolved OrbitElements, ok bool) {
|
||||
resolved = orbitElementsAt(jd, elements)
|
||||
func orbitTrueAnomalyAndRadius(jde float64, elements OrbitElements) (trueAnomaly, radius float64, resolved OrbitElements, ok bool) {
|
||||
resolved = orbitElementsAt(jde, elements)
|
||||
if resolved.usesPerihelionForm() {
|
||||
if !resolved.validPerihelionForm() {
|
||||
return math.NaN(), math.NaN(), resolved, false
|
||||
}
|
||||
switch {
|
||||
case math.Abs(resolved.E-1) <= orbitParabolicTolerance:
|
||||
return orbitParabolicTrueAnomalyAndRadius(jd, resolved)
|
||||
return orbitParabolicTrueAnomalyAndRadius(jde, resolved)
|
||||
case resolved.E < 1:
|
||||
return orbitEllipticTrueAnomalyAndRadiusFromPerihelion(jd, resolved)
|
||||
return orbitEllipticTrueAnomalyAndRadiusFromPerihelion(jde, resolved)
|
||||
default:
|
||||
return orbitHyperbolicTrueAnomalyAndRadius(jd, resolved)
|
||||
return orbitHyperbolicTrueAnomalyAndRadius(jde, resolved)
|
||||
}
|
||||
}
|
||||
if !resolved.validEllipticClassical() {
|
||||
return math.NaN(), math.NaN(), resolved, false
|
||||
}
|
||||
meanAnomalyDeg, ok := orbitMeanAnomalyDegAt(jd, elements)
|
||||
meanAnomalyDeg, ok := orbitMeanAnomalyDegAt(jde, elements)
|
||||
if !ok {
|
||||
return math.NaN(), math.NaN(), resolved, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user