onekiloparsec / SwiftAA

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

Calculate Moonphase for Date #63

Closed Styx665 closed 7 years ago

Styx665 commented 7 years ago

Hi, I just stumbled over this great repo. I'm looking for a function to calculate the moon phase for a specific Date. I'm pretty sure this task can be solved with your code, but I'm a absolute beginner at this topic. Could you please tell me which functions I need ?

onekiloparsec commented 7 years ago

You need is to instantiate a Moon object for a given date/julian day, and the following 3 methods you are interested in are: phaseAngle(), illuminatedFraction() and positionAngleOfTheBrightLimb().

onekiloparsec commented 7 years ago

Noe however that unit tests are missing for this part. I'll make sure to cover code with it for milestone 2.0.