1. Limited time only! Sign up for a free 30min personal 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!

Going from polar coor. to cartesian coor.

  1. Aug 2, 2012 #1
    Hello, I recently run into a problem. Lets say I have the point (a,b) and (-a,-b). The, I know that θ_1 = atan(b/a) and θ_2 = atan((-b)/(-a)) = θ_1.

    But, what if I want to go back to Cartesian coordinates? If I assume r = 1,
    a = cos(θ_1) and b = sin(θ_1) while
    -a = cos(θ_2) and b = sin(θ_2).

    I am sure this is very simple and it has to do with the fact that the range of atan is (-π/2,π/2). But is there a way of getting back the -a? Could I just add π to the angle whenever a and b are negatives?
     
  2. jcsd
  3. Aug 2, 2012 #2

    mathman

    User Avatar
    Science Advisor
    Gold Member

    Atan is multivalued, so you need to use more information to get the angle.
     
  4. Aug 2, 2012 #3

    jbriggs444

    User Avatar
    Science Advisor

    In a word, yes. If a and b are both negative, then the point is in the third quadrant and you would need to add ∏ to atan(b/a) to derive θ_2. [Alternately you could decide to use a non-canonical polar representation with a negative value for r].

    And yes, ignoring your sign omission, -a = cos(θ_2) and -b = sin(θ_2).

    Some math libraries have a two-argument "atan2" function that figures the quadrants out for you so that the range of the atan2 is the full -∏ (exclusive) to +∏ (inclusive). This function also avoids the divide by zero problem for points on the y axis.

    http://en.wikipedia.org/wiki/Atan2
     
  5. Aug 3, 2012 #4
    I can certainly use atan2. Thank you.
     
  6. Aug 4, 2012 #5
  7. Aug 5, 2012 #6

    mathman

    User Avatar
    Science Advisor
    Gold Member

    Multivalued means there is more than one value for the given argument. Atan, like asin and acos are multivalued. Atan2 is also multivalued, but as long as you stay within an interval of 2π you will get a unique answer. For atan the interval is π, so you need to know the sign of y or x to get the right value.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Going from polar coor. to cartesian coor.
  1. Polar To Cartesian (Replies: 4)

Loading...