Formula
$$d=\sqrt{r_1^2+r_2^2-2r_1r_2\cos\left(\phi_2-\phi_1\right)}$$
Variables
A(r1, φ1)
→
First point in polar coordinates
B(r2, φ2)
→
Second point in polar coordinates