Conversion between Rectangular and Polar Coordinates