Курсовая работа: Реализация класса для работы с комплексными числами
double r=sqrt(a.re*a.re+a.im*a.im);
21 |
double rn=pow(2,r);
double f1=(m*a.re/rn+2*3,14*k)/m;
double f2=(m*a.im/rn+2*3.14*k)/m;
cout << "Trigonom form vyshislenie korny a:" << endl;
cout << rn << "(cos(" << f1 << ") + isin(" << f2 << "))" << endl;
Complex t(m,k);
return t;
}
Complex operator == (Complex &a,Complex &b){
double r=sqrt(a.re*a.re+a.im*a.im);
double f2=a.re/r;
cout << "Eksponenta a:" << endl;
cout << r << "e^(i*" << f2 << ")" << endl;
Complex t(r,f2);
return t;
}
void Complex::ShowComplex(){
cout << "Vvedite chislo" <<endl;
cin >> re;
cin >> im;
cout << "Arif. forma: " << re << " + " << im << "i" << endl;
double z=sqrt(re*re+im*im);
cout << "Modul' shisla:" << z << endl;
cout << "Trigonom form" << endl;
double f=re/z;
double f1=im/z;
cout << z << "(cos(" << f << ") + isin(" << f1 << "))" << endl;