What are "p" and "r" wrt the moon?
Yes, the are angles in radians. With &quot;i=0.5&quot; to make things clearer:

$p=0$ is the right half illuminated
$p=\pi/2=1.57$ is top half illuminated  (rotated anticlockwise by 90 degrees)
$p=\pi=3.14$ is left half illuminated  (rotated 180 degrees)

and so on.
The r parameter is the rotation of the moon, so $r=0$ is &quot;lunar north up&quot; $r=pi/2$ is rotated anticlockwise by 90 degrees.