Convert Rectangular To Polar?
could please anyone check if my formula's are correct, i'm having a problem getting the correct angle, why i get 54.9999992537847 instead of 235.00?
x = -57.35764363
y = -81.9152044288992
r = sqr(x*x + y*y)
r = 100 -> correct
θ = arctan(y/x) '
θ = 54.9999992537847 -> wrong must be 235.00
Comments
The trouble is, tan(y/x)=angle has more than one solution in the interval 0 to 360 degrees. The calculator will only give you the Quadrant 1 or Quadrant 4 solution. In this case the correct answer will be a Quadrant 3 solution, because that's where the x<0,y<0 angles are. Here's a table that tells you how to solve tan(angle)=y/x using the calculator arctan function:
x>0 y>=0 Quadrant 1 angle=arctan(y/x)
x=0 y>0 angle=90
x<0 y>=0 Quadrant 2 angle=180+arctan(y/x)
x>0 y<=0 Quadrant 4 angle=360+arctan(y/x)
x=0 y<0 angle=270
x<0 y<=0 Quadrant 3 angle=180+arctan(y/x)
You have done it right. this angle will be in quadrant 3 which is why it is 235.
in quadrant 3, both the x and y are negative.
tanθ = (y/x) =-(-81.9152/-57.358)=1.4211
θ = 54..87or
theta=180+54.87=235.
because x& y are both negative, so theta lies in the third quadrant.