Finding rectangular coordinates from given polar coordinates