The distance is √r21+r22−2r1r2cos(θ1−θ2) if we are given P1=(r1,θ1) and P2=(r2,θ2)
This is an application of the cosine law. Taking the difference between θ1 andθ2 gives us the angle between side r1 and side r2. And the cosine law gives us the length of the 3rd side.