#include #include #include #include //for sqrt using namespace std; int main() { complex a(3); //last argument defaults to 0.0 complex b(0, 4); complex c; //arguments default to 0.0, 0.0 cout << b << "\n" << "x, y coordinates: " << b.real() << ", " << b.imag() << "\n" << "r, theta coordinates: " << abs(b) << ", " << arg(b) << "\n" << "distance from origin: " << sqrt(norm(b)) << "\n" << "distance from a: " << sqrt(norm(b - a)) << "\n"; return EXIT_SUCCESS; }