Lately, I was reading this snippet by vegaseat. I thought, why not do it in C#? But I would also like to add lattitude and logitude in the celestial calculations and draw a picture of the moon at that moment and location. Now the calculations can get a bit involved but are doable. So first I did a little try out about the drawing of a moon phase picture. Code for the main drawing method is given here. Just call it from a Paint event. A litte project file for a test app is included in a zip file as is a picture of how it looks.