2026-05-01 22:38:44 +08:00
|
|
|
package basic
|
|
|
|
|
|
|
|
|
|
import . "b612.me/astro/tools"
|
|
|
|
|
|
|
|
|
|
// MoonBrightLimbPositionAngle 月亮明亮边缘位置角 / position angle of the Moon's bright limb.
|
2026-09-23 18:55:12 +08:00
|
|
|
func MoonBrightLimbPositionAngle(jde float64) float64 {
|
|
|
|
|
return MoonBrightLimbPositionAngleN(jde, -1)
|
2026-05-01 22:38:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MoonBrightLimbPositionAngleN 月亮明亮边缘位置角(截断版) / truncated position angle of the Moon's bright limb.
|
2026-09-23 18:55:12 +08:00
|
|
|
func MoonBrightLimbPositionAngleN(jde float64, n int) float64 {
|
|
|
|
|
sunRA, sunDec := HSunApparentRaDecN(jde, n)
|
|
|
|
|
moonRA, moonDec := HMoonTrueRaDecN(jde, n)
|
2026-05-01 22:38:44 +08:00
|
|
|
return brightLimbPositionAngleFromRaDec(sunRA, sunDec, moonRA, moonDec)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MoonTopocentricBrightLimbPositionAngle 月亮站心明亮边缘位置角 / topocentric position angle of the Moon's bright limb.
|
2026-09-23 18:55:12 +08:00
|
|
|
func MoonTopocentricBrightLimbPositionAngle(jde, observerLon, observerLat, height float64) float64 {
|
|
|
|
|
return MoonTopocentricBrightLimbPositionAngleN(jde, observerLon, observerLat, height, -1)
|
2026-05-01 22:38:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MoonTopocentricBrightLimbPositionAngleN 月亮站心明亮边缘位置角(截断版) / truncated topocentric position angle of the Moon's bright limb.
|
2026-09-23 18:55:12 +08:00
|
|
|
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)
|
2026-05-01 22:38:44 +08:00
|
|
|
return brightLimbPositionAngleFromRaDec(sunRA, sunDec, moonRA, moonDec)
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-23 18:55:12 +08:00
|
|
|
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)
|
2026-05-01 22:38:44 +08:00
|
|
|
}
|
|
|
|
|
|
2026-09-23 18:55:12 +08:00
|
|
|
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)
|
2026-05-01 22:38:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|