Replies: 1 comment 6 replies
-
Hi @costular and welcome to the project! Are you trying to determine which of the 8 phases the Moon is closest to? Or are you trying to find the time when the Moon reaches an exact phase? If it is the first one, you can take the ecliptic longitude angle, divide by (360/8) = 45 degrees, and round to the nearest integer. You would have to watch out for the special case of rounding up to 8 or rounding down to 0 both indicating a new moon. Or maybe instead of finding the nearest phase, you want to find the most recent phase that has been reached. In that case you would take the floor of the ratio, rather than rounding. If it is the second case (searching), take a look at searchMoonPhase. If you pass that function 45 degrees as the phase angle, it will find the exact moment of Waxing Crescent. I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi!
First of all, @cosinekitty thanks a lot for this library, an enjoyer of the Kotlin library here! 🙋🏼
Now, I have a question (probably silly one) regarding the moon phases. I can see that moonPhase returns the Moon's phase as an angle, then it can be transformed into the different quarters (new moon, first quarter, full moon, third quarter).
However, is there any way to obtain the 8 moon phases (New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Last Quarter and Waning Crescent)? 🤔
Thank you in advance 🙇🏼
Beta Was this translation helpful? Give feedback.
All reactions