This is a cool problem. I'm thinking of the halfway point of the top side of the rectangle to be the centre of your coordinate system. Theta ranges from 0 to 2pi as usual, in counter-clockwise direction.

You'll have four pieces. The first, between 0 and pi, is easy -- almost trivial. The next three are more difficult; you will have to define straight lines. Just use the equations for converting between cartesian and polar coordinates.

To determine the borders of the piecewise bits, draw a picture and look at the angles -- draw lines between the corners of the rectangle and the centre point, and look at the angles that they make.