Vector::ImagPart Method

Overload List

#SignatureDescription
1TMtxVec *ImagPart(TMtxVec *Vec) const;Gets the imaginary part of a complex object.
2TMtxVec *ImagPart(TMtxVec *Vec, int VecIndex, int Index, int Len) const;Gets the imaginary part of complex object Vec elements [VecIndex]..[VecIndex+Len-1].

Overload 1: TMtxVec *ImagPart(TMtxVec *Vec) const;

Gets the imaginary part of a complex object.

#NameTypeDescription
1VecTMtxVec *
Remarks:

Gets the imaginary part of a complex object Vec and stores the real results in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match Vec object. Vec Vector::Complex must be true otherwise the exception will be raised.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a, b;

    a.SetIt(true, DewArray<double>{1, 2, 3, 4}); // a= [1+2i, 3+4i]
    b.ImagPart(a); // b = [2, 4]
}
See Also: Vector::RealPart, Vector::RealToCplx
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtxVec *ImagPart(TMtxVec *Vec, int VecIndex, int Index, int Len) const;

Gets the imaginary part of complex object Vec elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVec *
2VecIndexint
3Indexint
4Lenint
Remarks:

Stores the result in calling object. An exception is raised if the calling object is complex, if Vec is not complex or if array borders are overrun/underrun.

Examples
#include "MtxExpr.h"
#include "Units.Math387.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;

void Example()
{
    Vector a, b;

    a = {Cplx(1, 2), Cplx(3, 4)}; // a= [1+2i, 3+4i]
    b.ImagPart(a); // b = [2, 4]
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler