Illuminated fraction of the Moon from phase angle.
i is the phase angle in radians.
i
double illuminated(double i) => (1 + math.cos(i)) / 2;