GetPhase
Get the phase angle of the complex vector.
int GetPhase( vector & vPhase )
Returns 0 on success or -1 on failure.
EX1
void vectorbase_GetPhase_ex1() { vector<complex> vecC = {1+2i, 3+4i, 5+6i, 7+8i}; vector vecPh; vecC.GetPhase(vecPh); for (int ii = 0; ii < vecPh.GetSize(); ii++) printf("%.2f ",vecPh[ii]); // Result: // vecPh = {1.11, 0.93, 0.88, 0.85}; }
Get the phase angle of the complex vector in radians. Causes a runtime error if the underlying base type of the vector is not complex data type.
vectorbase::GetReal, vectorbase::GetImaginary, vectorbase::GetAmplitude, vectorbase::Conjugate, vectorbase::MakeComplex
origin.h