How to get the angle between polar coordinates without converting to cartesian

8.3k Views Asked by At

I'm trying to work out a way to get the angle between two points given in polar coordinates, without first converting them to x,y. I (sort of) remember enough high school trig to do it with x,y but I'm stumped at trying to do it with r, theta. I've found the Haversine formula, but that's to find the central angle between two points on a circle. That's not the angle I mean. I mean the one you'd get from atan(y1 - y0 / x1 - x0) if you wanted to convert your polars to cartesians. I hope I'm expressing that right; I'm doing this with javascript, so I'm doing Math.atan2(y1 - y0, x1 - x0). But I'd like to do it with r, theta, if I could figure out a way.

P.S. Just 2D, not looking for any hugely generalized form, if that matters at all.

Edit, in case it helps:

enter image description here

2

There are 2 best solutions below

3
On BEST ANSWER

You can get the distance between the points using Cos Law

$$ d^2 = r_1^2 + r_2^2 - 2 r_1 r_2 \cos( \theta_2 - \theta_1 ) $$

Now use Sine Law to get the angle $\alpha$ opposite $r_2$

$$ \frac{\sin \alpha}{ r_2} =\frac{\sin (\theta_2 - \theta_1 )}{ d} $$ The angle that the line joining the 2 points makes with the x-axis is just $\theta_1-\alpha$

0
On

i tried to figured out the angle that you want, so in the photo you will see that i don't use cartesian coordinates to solve the problem but if you take a look in the answer that i gave in the photo you can simplyfied the problem only using the conversion formulas of cartesian to polar coordinates like:


x=Rcos(θ) and


y=Rsin(θ)

Solving Problem...

sorry about the picture but i can not turn it