# How do you find the distance between 2 polar coordinates?

Dec 19, 2014

Yes! It is possible to derive formulae for both the two-dimensional and three-dimensional cases in polar coordinates. The following are the formulae:

2-D Polar Coordinates : \vec{r_A}=(r_A,\theta_A); \qquad \vec{r}_B=(r_B, \theta_B)
$S = \setminus \sqrt{| \setminus {\vec{r}}_{B} - \setminus {\vec{r}}_{A} {|}^{2}} = \setminus \sqrt{{r}_{A}^{2} + {r}_{B}^{2} - 2 {r}_{A} {r}_{B} \setminus \cos \left(\setminus {\theta}_{B} - \setminus {\theta}_{A}\right)}$

3-D Spherical Polar Coordinates :
\vec{r_A}=(r_A,\theta_A,\phi_A); \qquad \vec{r}_B=(r_B, \theta_B, \phi_B)
$S = \setminus \sqrt{| \setminus {\vec{r}}_{B} - \setminus {\vec{r}}_{A} {|}^{2}}$
$= \setminus \sqrt{{r}_{A}^{2} + {r}_{B}^{2} - 2 {r}_{A} {r}_{B} \left[\setminus \sin \setminus {\theta}_{A} \setminus \sin \setminus {\theta}_{B} \setminus \cos \left(\setminus {\phi}_{B} - \setminus {\phi}_{A}\right) + \setminus \cos \setminus {\theta}_{A} \setminus \cos \setminus {\theta}_{B}\right]}$

Deriving these formulae requires writing the position vectors in their cartesian forms and apply the Pythagorous Theorem to find the distance between two points in space. The following trigonometric identities might be useful for this problem :

• $\setminus \cos \left(A - B\right) = \setminus \cos \left(A\right) \setminus \cos \left(B\right) + \setminus \sin \left(A\right) \setminus \sin \left(B\right)$
• $\setminus {\sin}^{2} A + \setminus {\cos}^{2} A = 1$

Derivation of 2-D Formula :
\vec{r}_A=(r_A, \theta_A) = (X_A, Y_A); \qquad \vec{r}_B=(r_B, \theta_B) = (X_B, Y_B);
X_A=r_A\cos\theta_A, \quad Y_A=r_A\sin\theta_A;
X_B=r_B\cos\theta_B, \quad Y_B=r_B\sin\theta_B;

The distance between the two points is:
$S = \setminus \sqrt{| \setminus {\vec{r}}_{B} - \setminus {\vec{r}}_{A} {|}^{2}} = \setminus \sqrt{{\left({X}_{B} - {X}_{A}\right)}^{2} + {\left({Y}_{B} - {Y}_{A}\right)}^{2}}$
$S = \setminus \sqrt{{\left({r}_{B} \setminus \cos \setminus {\theta}_{B} - {r}_{A} \setminus \cos \setminus {\theta}_{A}\right)}^{2} + {\left({r}_{B} \setminus \sin \setminus {\theta}_{B} - {r}_{A} \setminus \sin \setminus {\theta}_{A}\right)}^{2}}$

Upon expanding the squares and further simplification,
$S = \setminus \sqrt{{r}_{A}^{2} \left(\setminus {\cos}^{2} \setminus {\theta}_{A} + \setminus {\sin}^{2} \setminus {\theta}_{A}\right) + {r}_{B}^{2} \left(\setminus {\cos}^{2} \setminus {\theta}_{B} + \setminus {\sin}^{2} \setminus {\theta}_{B}\right) - 2 {r}_{A} {r}_{B} \left(\setminus \cos \setminus {\theta}_{A} \setminus \cos \setminus {\theta}_{B} + \setminus \sin \setminus {\theta}_{A} \setminus \sin \setminus {\theta}_{B}\right)}$
$S = \setminus \sqrt{{r}_{A}^{2} + {r}_{B}^{2} - 2 {r}_{A} {r}_{B} \setminus \cos \left(\setminus {\theta}_{B} - \setminus {\theta}_{A}\right)}$

Derivation of 3-D Formula :
\vec{r}_A=(r_A, \theta_A,\phi_A) = (X_A, Y_A,Z_A);
\vec{r}_B=(r_B, \theta_B,\phi_B) = (X_B, Y_B,Z_B);

X_A=r_A\sin\theta_A\cos\phi_A, \quad Y_A=r_A\sin\theta_A\sin\phi_A; Z_A=r_A\cos\theta_A

X_B=r_B\sin\theta_B\cos\phi_B, \quad Y_B=r_B\sin\theta_B\sin\phi_B; Z_B=r_B\cos\theta_B

The distance between the two points is:
$S = \setminus \sqrt{| \setminus {\vec{r}}_{B} - \setminus {\vec{r}}_{A} {|}^{2}} = \setminus \sqrt{{\left({X}_{B} - {X}_{A}\right)}^{2} + {\left({Y}_{B} - {Y}_{A}\right)}^{2} + {\left({Z}_{B} - {Z}_{A}\right)}^{2}}$

• ${\left({X}_{B} - {X}_{A}\right)}^{2} = {\left({r}_{B} \setminus \sin \setminus {\theta}_{B} \setminus \cos \setminus {\phi}_{B} - {r}_{A} \setminus \sin \setminus {\theta}_{A} \setminus \cos \setminus {\phi}_{A}\right)}^{2}$
• ${\left({Y}_{B} - {Y}_{A}\right)}^{2} = {\left({r}_{B} \setminus \sin \setminus {\theta}_{B} \setminus \sin \setminus {\phi}_{B} - {r}_{A} \setminus \sin \setminus {\theta}_{A} \setminus \sin \setminus {\phi}_{A}\right)}^{2}$
• ${\left({Z}_{B} - {Z}_{A}\right)}^{2} = {\left({r}_{B} \setminus \cos \setminus {\theta}_{B} - {r}_{A} \setminus \cos \setminus {\theta}_{A}\right)}^{2}$

Upon expanding the squares and further simplification,

$S = \setminus \sqrt{{r}_{A}^{2} \left(\setminus {\cos}^{2} \setminus {\theta}_{A} + \setminus {\sin}^{2} \setminus {\theta}_{A}\right) + {r}_{B}^{2} \left(\setminus {\cos}^{2} \setminus {\theta}_{B} + \setminus {\sin}^{2} \setminus {\theta}_{B}\right) - 2 {r}_{A} {r}_{B} \left[\setminus \sin \setminus {\theta}_{A} \setminus \sin \setminus {\theta}_{B} \left(\setminus \cos \setminus {\phi}_{A} \setminus \cos \setminus {\phi}_{B} + \setminus \sin \setminus {\phi}_{A} \setminus \sin \setminus {\phi}_{B}\right) + \setminus \cos \setminus {\theta}_{A} \setminus \cos \setminus {\theta}_{B}\right]}$

$= \setminus \sqrt{{r}_{A}^{2} + {r}_{B}^{2} - 2 {r}_{A} {r}_{B} \left[\setminus \sin \setminus {\theta}_{A} \setminus \sin \setminus {\theta}_{B} \setminus \cos \left(\setminus {\phi}_{B} - \setminus {\phi}_{A}\right) + \setminus \cos \setminus {\theta}_{A} \setminus \cos \setminus {\theta}_{B}\right]}$