I'm trying to convert (-3,0) to polar coordinate.
I can get
r=$\sqrt {(-3)^2 +(0)^2}$ =3,
but when computing for the angle
$\theta$=$\tan^{-1} (\frac {0}{-3})$=0
but the answer for the angle is $\pi$, I don't understand why the answer is $\pi$ instead of 0 degree, can anyone explain this? TQ
Well, draw a picture showing the location of the point $(-3,0)$, and ask yourself what direction you'd need to go (from the origin) to get to it. Using an angle of $\theta = 0$ will send you along the positive $x$-axis, which is obviously wrong.
You can't get the polar angle from the inverse tangent function alone. You need to find an angle $\theta$ such that $r\cos\theta = x$ and $r\sin\theta=y$. In programming terms, you need to use the ATAN2 function to do this; the ATAN function is not sufficient. As you have already seen, there are two angles $\theta$ that give $\tan\theta = 0$, and the ATAN function won't tell you which of the two is correct.