It's really hard to answer these questions when you don't specify what any of the terms mean, so I can only guess at what rr' even is. It looks like a Pythagoras approach to give you the hypotenuse of the triangle with sides r and zz0.
How would you use the law of cosine, and what problem would using it solve?
