We calculate r by the Pythagorean theorem: You do the cotangent which is adjacent/opposite = x/y Edwin