Convert the point (x, y) towhatangle? Do you mean the angle the line through (0, 0) and (x, y) makes with the x-axis? That appears to be what your pictures show. If so then you need to look at the right triangle which has vertices at (0, 0), (x, y), and (x, 0). That has its right angle at (x, 0) and has so that . One complication is that, since the tangent function is NOT one to one, the arctangent is defined only for . So, if you want [itex]\theta[/itex] from 0 to 360 degrees, you will need an algorithm like

If x= 0, if y>0 else (to avoid dividing by 0)

else, A= arctan(y/x) {If If A>0 and then else }

else ( now) if A> 0, else