16c62a97d5
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
46 lines
2.3 KiB
Go
46 lines
2.3 KiB
Go
package basic
|
|
|
|
import . "b612.me/astro/tools"
|
|
|
|
// MoonBrightLimbPositionAngle 月亮明亮边缘位置角 / position angle of the Moon's bright limb.
|
|
func MoonBrightLimbPositionAngle(jde float64) float64 {
|
|
return MoonBrightLimbPositionAngleN(jde, -1)
|
|
}
|
|
|
|
// MoonBrightLimbPositionAngleN 月亮明亮边缘位置角(截断版) / truncated position angle of the Moon's bright limb.
|
|
func MoonBrightLimbPositionAngleN(jde float64, n int) float64 {
|
|
sunRA, sunDec := HSunApparentRaDecN(jde, n)
|
|
moonRA, moonDec := HMoonTrueRaDecN(jde, n)
|
|
return brightLimbPositionAngleFromRaDec(sunRA, sunDec, moonRA, moonDec)
|
|
}
|
|
|
|
// MoonTopocentricBrightLimbPositionAngle 月亮站心明亮边缘位置角 / topocentric position angle of the Moon's bright limb.
|
|
func MoonTopocentricBrightLimbPositionAngle(jde, observerLon, observerLat, height float64) float64 {
|
|
return MoonTopocentricBrightLimbPositionAngleN(jde, observerLon, observerLat, height, -1)
|
|
}
|
|
|
|
// MoonTopocentricBrightLimbPositionAngleN 月亮站心明亮边缘位置角(截断版) / truncated topocentric position angle of the Moon's bright limb.
|
|
func MoonTopocentricBrightLimbPositionAngleN(jde, observerLon, observerLat, height float64, n int) float64 {
|
|
sunRA, sunDec := sunTopocentricApparentRaDecN(jde, observerLon, observerLat, height, n)
|
|
moonRA, moonDec := moonTopocentricApparentRaDecN(jde, observerLon, observerLat, height, n)
|
|
return brightLimbPositionAngleFromRaDec(sunRA, sunDec, moonRA, moonDec)
|
|
}
|
|
|
|
func moonTopocentricApparentRaDecN(jde, observerLon, observerLat, height float64, n int) (float64, float64) {
|
|
geocentricRA := HMoonTrueRaN(jde, n)
|
|
geocentricDec := HMoonTrueDecN(jde, n)
|
|
distanceAU := HMoonAwayN(jde, n) / moonPhysicalAstronomicalUnitKM
|
|
return TopocentricRaDec(geocentricRA, geocentricDec, observerLat, observerLon, TT2UTC(jde), distanceAU, height)
|
|
}
|
|
|
|
func sunTopocentricApparentRaDecN(jde, observerLon, observerLat, height float64, n int) (float64, float64) {
|
|
geocentricRA, geocentricDec := HSunApparentRaDecN(jde, n)
|
|
return TopocentricRaDec(geocentricRA, geocentricDec, observerLat, observerLon, TT2UTC(jde), EarthAwayN(jde, n), height)
|
|
}
|
|
|
|
func brightLimbPositionAngleFromRaDec(sunRA, sunDec, bodyRA, bodyDec float64) float64 {
|
|
y := Cos(sunDec) * Sin(sunRA-bodyRA)
|
|
x := Sin(sunDec)*Cos(bodyDec) - Cos(sunDec)*Sin(bodyDec)*Cos(sunRA-bodyRA)
|
|
return ArcTan2(y, x)
|
|
}
|