# Finding Distance Between Polar Coordinates

## Key Questions

• Hello,

• In a orthonormal basis, the distance between $A \left(x , y\right)$ and $A ' \left(x ' , y '\right)$ is

$d = \sqrt{{\left(x - x '\right)}^{2} + {\left(y - y '\right)}^{2}}$.

• With polar coordinates, $A \left[t , \theta\right]$ and $A ' \left[r ' , \theta '\right]$, you have to write the relations :

$x = r \cos \theta , y = r \sin \theta$
$x ' = r ' \cos \theta ' , y ' = r ' \sin \theta '$,

So,

$d = \sqrt{{\left(r \cos \theta - r ' \cos \theta '\right)}^{2} + {\left(r \sin \theta - r ' \sin \theta '\right)}^{2}}$

Develop, and use the formula ${\cos}^{2} x + {\sin}^{2} x = 1$. So you get :

$d = \sqrt{{r}^{2} - 2 r r ' \left(\cos \theta \cos \theta ' + \sin \theta \sin \theta '\right) + r {'}^{2}}$

Finally, you know that $\cos \theta \cos \theta ' + \sin \theta \sin \theta ' = \cos \left(\theta - \theta '\right)$, therefore,

$d = \sqrt{{r}^{2} + r {'}^{2} - 2 r r ' \cos \left(\theta - \theta '\right)}$.

• Let say you have points A(r_1,θ_1),Β(r_2,θ_2) you must convert them to cartesian coordinates A(x_1,y_1),Β(x_2,y_2) and then use the distance formula $D = \sqrt{{\left({x}_{2} - {x}_{1}\right)}^{2} + {\left({y}_{2} - {y}_{1}\right)}^{2}}$

See below.

#### Explanation:

Given in cartesian coordinates.

${P}_{1} = \left({x}_{1} , {y}_{1}\right)$ and ${P}_{2} = \left({x}_{2} , {y}_{2}\right)$

the transition formulas

$\left\{\begin{matrix}x = r \cos \theta \\ y = r \sin \theta\end{matrix}\right.$

then

$\left({x}_{1} , {y}_{1}\right) \Rightarrow \left({r}_{1} \cos {\theta}_{1} , {r}_{1} \sin {\theta}_{1}\right)$
$\left({x}_{2} , {y}_{2}\right) \Rightarrow \left({r}_{2} \cos {\theta}_{2} , {r}_{2} \sin {\theta}_{2}\right)$

so

$d = \sqrt{{\left({x}_{1} - {x}_{2}\right)}^{2} + {\left({y}_{1} - {y}_{2}\right)}^{2}} \Rightarrow \sqrt{{\left({r}_{1} \cos {\theta}_{1} - {r}_{2} \cos {\theta}_{2}\right)}^{2} + {\left({r}_{1} \sin {\theta}_{1} - {r}_{2} \sin {\theta}_{2}\right)}^{2}}$

then

$d = \sqrt{{r}_{1}^{2} + {r}_{2}^{2} - 2 {r}_{1} {r}_{2} \left(\cos {\theta}_{1} \cos {\theta}_{2} + \sin {\theta}_{1} \sin {\theta}_{2}\right)} = \sqrt{{r}_{1}^{2} + {r}_{2}^{2} - 2 {r}_{1} {r}_{2} \cos \left({\theta}_{1} - {\theta}_{2}\right)}$