GetAmplitude
Get the amplitude (modulus) of the complex vector.
int GetAmplitude( vector & vAmplitude )
Returns 0 on success and -1 on failure.
EX1
void vectorbase_GetAmplitude_ex1() { vector<complex> vecC = {1+2i, 3+4i, 5+6i, 7+8i}; vector vecAmp; vecC.GetAmplitude(vecAmp); for (int ii = 0; ii < vecAmp.GetSize(); ii++) printf("%0.2f ",vecAmp[ii]); // Result: // vecAmp = {2.24, 5.00, 7.81, 10.63}; }
Get the amplitude (modulus) of the complex vector. Causes a runtime error if the underlying base type of the vector is not complex.
vectorbase::GetReal, vectorbase::GetImaginary, vectorbase::GetPhase, vectorbase::Conjugate, vectorbase::MakeComplex
origin.h