#include "TComplex.h"
#include "Riostream.h"
ClassImp(TComplex)
TComplex::TComplex(Double_t re, Double_t im, Bool_t polar) : fRe(re), fIm(im)
{
if (polar) {
if(re<0) {
::Warning("TComplex::ctor","Modulo of a complex number should be >=0, taking the abs");
re=-re;
}
fRe=re*TMath::Cos(im);
fIm=re*TMath::Sin(im);
}
}
ostream& operator<<(ostream& out, const TComplex& c)
{
out << "(" << c.fRe << "," << c.fIm << "i)";
return out;
}
istream& operator>>(istream& in, TComplex& c)
{
in >> c.fRe >> c.fIm;
return in;
}
Last change: Tue Aug 12 09:13:55 2008
Last generated: 2008-08-12 09:13
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.