convert rectangular coordinate (-3,0) to polar coordinate 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
 A: 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.
A: Since the result of the $\arctan$ function only ranges from $-\pi$ to $\pi$, you can't get the full circle of angles necessary to represent all points in the plane.
There are at least two approaches to getting the correct argument, both using $r=\sqrt{x^2+y^2}$
One can case on the sign of $x$:
$$
\newcommand{sgn}{\operatorname{sgn}}
\theta=\left\{\begin{array}{}
\frac\pi2\sgn(y)&\text{if }x=0\\
\arctan\left(\dfrac yx\right)&\text{if }x\gt0\\
\arctan\left(\dfrac yx\right)+\pi&\text{if }x\lt0\text{ and }y\gt0\\
\arctan\left(\dfrac yx\right)-\pi&\text{if }x\lt0\text{ and }y\lt0\\
\pi&\text{if }x\lt0\text{ and }y=0
\end{array}\right.
$$
One can use
$$
\theta=\left\{\begin{array}{}
0&\text{if }r+x=0\text{ and }x=0\\
\pi&\text{if }r+x=0\text{ and }x\ne0\\
2\arctan\left(\frac{y}{r+x}\right)&\text{if }r+x\ne0
\end{array}\right.
$$
Both of these give $r=3$ and $\theta=\pi$ for $(-3,0)$.
A: To understand it first, plot $(-3, 0)$ on the Cartesian plane, and observe that it is $3$ units to the left of the origin.  In polar coordinates, points with $r > 0$ and $\theta = 0$ are to the right of the origin; one must swing $180$ degrees—that is, $\pi$ radians—counterclockwise to end up on the left side of the origin.  (Alternatively, one can use negative $r$ and $\theta = 0$ to get on the left side; ironically, one obtains $(-3, 0)$ as also valid polar coordinates for the same point.)
Your problem in finding this out algorithmically stems from $\tan^{-1}$ having a limited range, from $-\pi/2$ to $\pi/2$.  In order to determine the proper answer algorithmically, follow lab bhattacharjee's link to atan2, a four-quadrant version of arctangent.
A: $ r = 3 $
$ \theta = \tan^{-1} 0 + \pi $ 
We have to add $\pi$, as the position of the tip of radius vector lies on the other side of origin for negative radius.
