#include #include #define PI 3.14159 // prototype void polar_to_cartesian(double rho, double theta, double &x, double &y); int main() { double rho, theta, x, y; cout << "Enter rho: "; cin >> rho; cout << "Enter theta: "; cin >> theta; polar_to_cartesian(rho, theta, x, y); cout << "In cartesian coordinates that is (" << x << "," << y << ")\n"; } // inputs: rho, theta (in degrees) // outputs: x y void polar_to_cartesian(double rho, double theta, double &x, double &y) { // convert theta from degrees to radians theta *= PI / 180.; x = rho * cos(theta); y = rho * sin(theta); }