Going from polar coor. to cartesian coor.

  • Thread starter Thread starter Marioqwe
  • Start date Start date
  • Tags Tags
    Cartesian Polar
AI Thread Summary
The discussion focuses on converting polar coordinates back to Cartesian coordinates, specifically addressing the challenge of determining the correct angle when both coordinates are negative. It is established that when both a and b are negative, the point lies in the third quadrant, necessitating the addition of π to the angle derived from atan(b/a) to obtain the correct θ. The use of the atan2 function is recommended, as it accounts for the quadrant and avoids issues like division by zero. The conversation clarifies that while atan is typically limited to a range of (-π/2, π/2), atan2 provides a broader range of (-π, π), ensuring a unique angle for each point. This approach simplifies the conversion process and enhances accuracy in coordinate transformations.
Marioqwe
Messages
65
Reaction score
4
Hello, I recently run into a problem. Let's 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?
 
Mathematics news on Phys.org
Atan is multivalued, so you need to use more information to get the angle.
 
Marioqwe said:
Hello, I recently run into a problem. Let's 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?

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
 
I can certainly use atan2. Thank you.
 
Matt Benesi said:
atan isn't multivalued- usually the format is: atan(y/x);

atan2 is multivalued... (wikipedia link to definition of atan2 in terms of extension of atan function)

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.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top