feat: 完善时标与天象几何计算并扩展输出接口
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
This commit is contained in:
+15
-15
@@ -3,37 +3,37 @@ package basic
|
||||
import . "b612.me/astro/tools"
|
||||
|
||||
// OrbitSunDistance 返回轨道目标在给定 TT/TDB 儒略日的日心距离,单位 AU。
|
||||
func OrbitSunDistance(jd float64, elements OrbitElements) float64 {
|
||||
_, _, distance := OrbitHeliocentricEclipticJ2000(jd, elements)
|
||||
func OrbitSunDistance(jde float64, elements OrbitElements) float64 {
|
||||
_, _, distance := OrbitHeliocentricEclipticJ2000(jde, elements)
|
||||
return distance
|
||||
}
|
||||
|
||||
// OrbitEarthDistance 返回轨道目标在给定 TT/TDB 儒略日的地心距离,单位 AU。
|
||||
func OrbitEarthDistance(jd float64, elements OrbitElements) float64 {
|
||||
_, _, distance := OrbitGeocentricEclipticJ2000(jd, elements)
|
||||
func OrbitEarthDistance(jde float64, elements OrbitElements) float64 {
|
||||
_, _, distance := OrbitGeocentricEclipticJ2000(jde, elements)
|
||||
return distance
|
||||
}
|
||||
|
||||
// OrbitPhaseAngle 返回轨道目标的相位角,单位度。
|
||||
func OrbitPhaseAngle(jd float64, elements OrbitElements) float64 {
|
||||
return ArcCos(orbitPhaseCosine(jd, elements))
|
||||
func OrbitPhaseAngle(jde float64, elements OrbitElements) float64 {
|
||||
return ArcCos(orbitPhaseCosine(jde, elements))
|
||||
}
|
||||
|
||||
// OrbitIlluminatedFraction 返回轨道目标的被照亮比例。
|
||||
func OrbitIlluminatedFraction(jd float64, elements OrbitElements) float64 {
|
||||
return (1 + orbitPhaseCosine(jd, elements)) / 2
|
||||
func OrbitIlluminatedFraction(jde float64, elements OrbitElements) float64 {
|
||||
return (1 + orbitPhaseCosine(jde, elements)) / 2
|
||||
}
|
||||
|
||||
// OrbitElongation 返回轨道目标相对于太阳的地心视角距,单位度。
|
||||
func OrbitElongation(jd float64, elements OrbitElements) float64 {
|
||||
lon, lat, _ := OrbitApparentGeocentricEcliptic(jd, elements)
|
||||
return StarAngularSeparation(lon, lat, HSunApparentLo(jd), HSunTrueBo(jd))
|
||||
func OrbitElongation(jde float64, elements OrbitElements) float64 {
|
||||
lon, lat, _ := OrbitApparentGeocentricEcliptic(jde, elements)
|
||||
return StarAngularSeparation(lon, lat, HSunApparentLo(jde), HSunTrueBo(jde))
|
||||
}
|
||||
|
||||
func orbitPhaseCosine(jd float64, elements OrbitElements) float64 {
|
||||
sunDistance := OrbitSunDistance(jd, elements)
|
||||
earthDistance := OrbitEarthDistance(jd, elements)
|
||||
earthSunDistance := EarthAway(jd)
|
||||
func orbitPhaseCosine(jde float64, elements OrbitElements) float64 {
|
||||
sunDistance := OrbitSunDistance(jde, elements)
|
||||
earthDistance := OrbitEarthDistance(jde, elements)
|
||||
earthSunDistance := EarthAway(jde)
|
||||
cosine := (sunDistance*sunDistance + earthDistance*earthDistance - earthSunDistance*earthSunDistance) / (2 * sunDistance * earthDistance)
|
||||
return clampUnit(cosine)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user