Moon phase

Moon phase shown in Astro Mosaic is based on my calculations so it may not be exactly correct. I could not find an example on that so I just calculate angle between sun and moon as seen from earth. That angle is then used to calculate moon phase.

When the moon and sun are on the same side angle is zero degrees and moon phase is 0%, when they are on opposite sides the moon phase is 100% and when angle is 90 degrees phase is 50%. And other vales are between those.