Use the Law of Cosines to prove that the distance between 2 polar points (r1, θ1) and (r2, θ2) is d2=r12+r22-2r1r2cos(θ2-θ1)
Let $\displaystyle P_{1}(r_{1},{\theta}_{1}) \;\ and \;\ P_{2}(r_{2}, {\theta}_{2})
$ be points in the $\displaystyle r{\theta}$ plane.
Let $\displaystyle a=r_{1}, \;\ b=r_{2}, \;\ c=d(P_{1},P_{2})$
and $\displaystyle {\gamma}={\theta}_{2}-{\theta}_{1}$
Sub these into the law of cosines, $\displaystyle c^{2}=a^{2}+b^{2}-2abcos{\gamma}$, gives the formula.