onekiloparsec / SwiftAA

The most comprehensive collection of accurate astronomical algorithms in (C++, Objective-C and) Swift.
http://www.onekiloparsec.dev/
MIT License
171 stars 31 forks source link

How to determine the moon phase like 🌑🌒🌓🌔🌕🌖🌗🌘 ? #105

Closed gongzhang closed 3 years ago

gongzhang commented 3 years ago

I'm still not quite sure how I should get the moon phase after reading https://github.com/onekiloparsec/SwiftAA/issues/63. 😂

The goal is to determine the current moon phase like: 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 . As I understand it, I need both Moon.phaseAngle and Moon.positionAngleOfTheBrightLimb information to draw the icon.

   phaseAngle  positionAngleOfTheBrightLimb

🌑   180°        ~ 260°
🌒   135           .
🌓   90°           .
🌔   45          ~ 290°
🌕   0           ~ 90°
🌖   45            .
🌗   90°           .
🌘   135           .
🌑   180°        ~ 80°

The Moon.phaseAngle is straightforward. However, how should I determine whether the left or right side of the moon is bright based on Moon.positionAngleOfTheBrightLimb? Also, this seems to assume that we all observe the moon from the northern hemisphere. Am I right?

HerrAlien commented 3 years ago

I'd use selenographicPositionOfTheSun() instead of positionAngleOfTheBrightLimb () , and examine the longitude.

Regards, Alex

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, May 11, 2021 at 7:34 PM Gong Zhang @.***> wrote:

I'm still not quite sure how I should get the moon phase after reading #63 https://github.com/onekiloparsec/SwiftAA/issues/63. 😂

The goal is to determine the current moon phase like: 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 . As I understand it, I need both Moon.phaseAngle and Moon.positionAngleOfTheBrightLimb information to draw the icon.

phaseAngle positionAngleOfTheBrightLimb

🌑 180° ~ 260°

🌒 135 .

🌓 90° .

🌔 45 ~ 290°

🌕 0 ~ 90°

🌖 45 .

🌗 90° .

🌘 135 .

🌑 180° ~ 80°

The Moon.phaseAngle is straightforward. However, how should I determine whether the left or right side of the moon is bright based on Moon.positionAngleOfTheBrightLimb? Also, this seems to assume that we all observe the moon from the northern hemisphere. Am I right?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/onekiloparsec/SwiftAA/issues/105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7JWREPRDKPBXFVDI2ELKDTNFL7RANCNFSM44WEIUSA .

gongzhang commented 3 years ago

@HerrAlien Thanks! 👍