We use the percent (fractional) change in the x mouse coordinate to compute the amount of change in the angle of longitude. Since the full range of this angle is 2PI radians, we take the fractional portion of this amount and add it to the current theta.
Since the full range of the angle of latitude is PI radians, we use the percent change in the y mouse coordinate for the change in the angle phi. To avoid the camera "flipping over" at the poles, we restrict the angle between -90 degrees and 90 degrees.
Now that we have updated angles based on user interaction, we convert the spherical coordinates to rectangular coordinates as seen here and store the values in movingEyePoint.