Going from polar coor. to cartesian coor.

In summary: But if you don't know the sign, then you don't have enough information to get the angle.In summary, the conversation discusses the use of atan and atan2 in converting between polar and Cartesian coordinates. It is mentioned that atan is multivalued and requires additional information to get the correct angle, while atan2 is multivalued but can provide a unique answer within an interval of 2π. The option of using a non-canonical polar representation is also mentioned.
  • #1
Marioqwe
68
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
  • #2
Atan is multivalued, so you need to use more information to get the angle.
 
  • #3
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
 
  • #4
I can certainly use atan2. Thank you.
 
  • #6
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.
 

1. How do you convert from polar coordinates to cartesian coordinates?

To convert from polar coordinates to cartesian coordinates, use the following equations:
x = r * cos(theta)
y = r * sin(theta)
Where r is the distance from the origin and theta is the angle measured from the positive x-axis.

2. What are the advantages of using cartesian coordinates over polar coordinates?

Cartesian coordinates are often easier to work with mathematically compared to polar coordinates. They also allow for a more intuitive visualization of geometric shapes and relationships.

3. Can you convert any point from polar coordinates to cartesian coordinates?

Yes, any point in polar coordinates can be converted to cartesian coordinates using the equations mentioned in answer 1.

4. How do you represent negative values in cartesian coordinates?

In cartesian coordinates, negative values are represented by coordinates on the left side of the origin for x and below the origin for y. For example, (-2,3) would be located 2 units to the left of the origin and 3 units above the origin.

5. Are cartesian coordinates the same as rectangular coordinates?

Yes, cartesian coordinates and rectangular coordinates refer to the same system of coordinates where points are located using x and y values. They are often used interchangeably.

Similar threads

  • Introductory Physics Homework Help
Replies
14
Views
2K
  • General Math
Replies
7
Views
2K
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
1K
Replies
13
Views
2K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
12
Views
3K
  • Advanced Physics Homework Help
Replies
10
Views
6K
  • Advanced Physics Homework Help
Replies
1
Views
2K
Back
Top