Converts rectangular coordinates into polar coordinates.