I finished a 7 hour coding assessment but missed a question that required too much math for me. It was a backend position but for some reason this game programming related question was included I am guessing just to gauge how much ability I would have should they want to consider transferring me in the future.
Apologies in advance for pasting images but I could not find anything similar online to link to because I am not a gamer and not familiar with where to find such things.
I can select an x,y pt on the game screen for a special attack. This point is relative to the player's position at the origin.
I am given parameters x,y I just mentioned, r which is the radius of the attack, ie. the distance from the origin towards the clicked x,y point in which the attack is valid as well as parameter d which is the angle in degrees to both sides of this the line r in which the attack is valid. Valid meaning monsters in this pie slice of the circle will get damage from the player's special attack.
Here is another picture:
The last paramter I am given are the (x,y) coordinates of all the monsters on the game screen.
I have to return the number of monsters that take damage, ie. are within the pie-shaped area of the attack range.
I know a tiny bit about polar to cartesian but not sure even where to begin with this.


Call the point $(x_1,y_1)$. It forms an angle of $\text{atan2} (y_1,x_1)$ from the origin. This angle plus/minus $d$ gives $\text{atan2} (y,x) ± d$, and since the slope of a line is $\tan \theta$ (think about opp/adj), the straight lines have equation $y = \tan(\text{atan2} (y_1,x_1) ± d)x$.
Thus the region is bounded by:
$$y ≥ \tan(\text{atan2} (y_1,x_1) + d)x$$ $$y ≥ \tan(\text{atan2} (y_1,x_1) - d)x$$ $$x^2+y^2≤r^2$$