I have three point charges with the cartesian coordinates:

$q_1(a,0,0) \: \: \: q_2(0,a,0) \: \: \: q_3(0,0,a) $,

I want to convert these into both cylindrical and spherical coordinates.

The cartesian coordinates are written like this: $(x,y,z)$

The cylindrical coordinates are written like this: $(r,\theta,z)$

The spheircal coordinates are written like this: $(\rho,\theta,\phi)$

From https://en.wikipedia.org/wiki/List_of_common_coordinate_transformations I found these conversion formulas going form cartesian to cylindrical:




My Problem

Now, I want to convert the cartesian coordinates $(a,0,0)$ into cylindrical. We go like this $$r=\sqrt{a^2+0^2}=a $$ $$\theta=\arctan(\frac{a}{0})=??? $$ $$z=z $$

My problem is that I don't how to handle the $\theta$ calculation when the y-coordinate is $0$. Can somebody help me here, or maybe I'm using a wrong formula?


1 Answer 1


You need to use the arctan2 function, which takes all 4 quadrants into account.

  • $\begingroup$ Thank you for your answer. But what do I do for the point $(0,0,a)$? The arctan2 function is not defined when $x = 0$ and $y = 0$. Is the cylindrical coordinates then just $(0,0,a)$? $\endgroup$
    – Carl
    Sep 13, 2020 at 8:17
  • 1
    $\begingroup$ @Carl You mean when $r = 0$? In that case, you can choose any angle $\theta$. $\endgroup$
    – user76284
    Sep 13, 2020 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.