Complex

Hi ,
I'm new in c++ and i learn c++ from java2s.com.There are many examples.
Could someone explain me,why complex is used in c++,please?
Example:#include <complex>
#include <iostream>

using namespace std;

int main( ) {
double rho = 3.0; // magnitude
double theta = 3.141592 / 2; // angle
complex<double> coord = polar(rho, theta);
cout << "rho = " << abs(coord) << ", theta = " << arg(coord) << endl;
coord += polar(4.0, 0.0);
cout << "rho = " << abs(coord) << ", theta = " << arg(coord) << endl;
}
The question is unclear. Are you asking what are complex numbers used for?
I mean where complex class and it's functions are used...
Could you explain with examples ,where complex numbers are useful for use..
Last edited on
They're used when complex numbers are needed, of course..
Topic archived. No new replies allowed.