Editorial for Facebook Hacker Cup '17 Qualifying Round P1 - Progress Pie

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

For each point, we need to check two things:

1) Is the point close enough to the center that it could be within the circle at all?

This is as simple as computing the distance between the point and the center of the circle: . This distance must be no greater than , the radius of the circle.

2) Is the point between the two lines that define the bounds of the current circle sector?

We'd like to know the angle of the given point in the reference frame where degrees is up and degrees is to the right, since that's the way the boundary of the circle sector moves as the progress increases.

Most languages have an atan2() function which can give you the angle from to a given point. However, this function puts degrees to the right and degrees upwards, so it's necessary to translate the output to the desired reference frame.

And of course, if , all points are white.