1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Converting from Cartesian to Cylindrical coords - but division by zero

  1. Sep 4, 2008 #1
    Converting from Cartesian to Cylindrical coords - but division by zero!!!

    1. The problem statement, all variables and given/known data

    Let's say I want to convert the point P(0, -4, 3) to cylindrical.

    To convert from Cartesian to Cylindrical coordinates, one must use the formulas listed below.



    2. Relevant equations

    [tex]\rho\,=\,\sqrt{x^2\,+\,y^2}[/tex]

    [tex]\phi\,=\,tan^{-1}\left(\frac{y}{x}\right)[/tex]

    [tex]z\,=\,z[/tex]



    3. The attempt at a solution

    What do I do about the division by zero produced by using the second equation for [itex]\phi[/itex]?

    [tex]\phi\,=\,tan^{-1}\left[\frac{(-4)}{(0)}\right][/tex]
     
  2. jcsd
  3. Sep 4, 2008 #2
    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    Becuase your point is P(0, -4, 3), really your on a 2D plane. But to explain this mathematically,

    [tex]\arctan^{-1}\left(\frac{-4}{0}\right) = \arctan^{-1}(\infty) = \frac{\pi}{2}[/tex]

    which is 90 degrees, so [tex]\rho[/tex] = [tex]\frac{\pi}{2}[/tex]

    and the rest should be straight forward. Hope that helps you.
     
  4. Sep 4, 2008 #3
    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    I guess I should complete the question so:

    [tex]\rho = \sqrt{0^2 + (-4)^2} = \sqrt(8) = 2\sqrt{2}[/tex]
    [tex]\phi = \frac{\pi}{2} = 1.57[/tex] (as shown above)
    z = 3

    Putting this as a vector,
    [tex](\rho,\phi,z)= (2\sqrt{2},1.57,3)[/tex]

    That should be the answer... but it seems a bit messy
     
  5. Sep 4, 2008 #4
    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!


    Thanks! That -4/0 = [itex]\infty[/itex] should have been obvious to me!

    Untoldstory, [tex]\sqrt{(0)^2\,+\,(-4)^2}\,=\,4[/tex], but otherwise it's correct:)
     
  6. Sep 4, 2008 #5

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    That is not quite the right equation for the angle. Think about it this way: What if x=y=-1? Your equation gives [itex]\phi=\arctan(-1/-1)=\arctan(1)=\pi/2[/itex]. Converting back to cartesian yields x=y=1. The problem is that the range of the inverse tangent is pi radians, but the angle needs to range over a full circle, 2*pi radians. You need to take the quadrant of the arguments into account. If you don't you will get a wrong answer. For example, 90 degrees (or pi/2) is the wrong answer.

    It is always a good idea to do a sanity check on your answers when working out problems. In this case, the sanity check is to convert back to cartesian to see if you get the same point you started with.
     
    Last edited: Sep 4, 2008
  7. Sep 4, 2008 #6
    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    So, on an x-y plane, the coordinates (0,-4) is on the negative y-axis between the third and fourth quadrants. So the angle is not really 90 degrees, but 270 degrees? Is that correct?
     
  8. Sep 5, 2008 #7

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    Correct. Wikipedia gives one way to do this: http://en.wikipedia.org/wiki/Polar_coordinates#Converting_between_polar_and_Cartesian_coordinates

    I like the simpler

    [tex]\phi = \begin{cases}
    \quad\arctan\frac y x & x > 0 \\
    \pi - \arctan\frac y {-x} & x < 0 \\
    \quad\;\phantom{-}\,\frac {\pi} 2 & x = 0, y > 0 \\
    \quad\;-\,\frac {\pi} 2 & x = 0, y < 0
    \end{cases}[/tex]

    and of course the angle is undefined if x=y=0.
     
  9. Sep 5, 2008 #8

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Converting from Cartesian to Cylindrical coords - but division by zero!!!

    (0, -4, 3) has z= 3 and (x,y)= (0, -4). That point is on the y-axis, 4 units below the origin: r= 4, and [itex]\theta= -\pi/4[/itex] or [itex]\theta= 3\pi/4[/itex].
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?