Vector::PolarToCart Method

Overload List

#SignatureDescription
1TMtxVec *PolarToCart(TMtxVec *AmpltVec, TMtxVec *PhaseVec) const;Converts the polar magnitude/phase pairs to cartesian pairs.
2TMtxVec *PolarToCart(TMtxVec *AmpltVec, TMtxVec *PhaseVec, int AIndex, int PIndex, int Index, int Len) const;Convert AmpltVec elements [AIndex]..[AIndex+Len-1] and PhaseVec elements [PIndex]..[PIndex+Len-1] from polar form (radius,angle) to cartesian form (X,y).

Overload 1: TMtxVec *PolarToCart(TMtxVec *AmpltVec, TMtxVec *PhaseVec) const;

Converts the polar magnitude/phase pairs to cartesian pairs.

#NameTypeDescription
1AmpltVecTMtxVec *
2PhaseVecTMtxVec *
Remarks:

Convert all AmpltVec and PhaseVec elements (combined) from polar to cartesian form. If AmpltVec and PhaseVec size is not the same , an exeption is raised. The results are stored as complex numbers (X=Re, y=Im) in the calling object. Size and Vector::Complex properties of the calling object are set implicitly to match AmpltVec and PhaseVec objects.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a, b, c;

    a.SetIt(false, DewArray<double>{1, 2, 3, 4}); // a = [1,2,3, 4] //magnitude
    b.SetIt(false, DewArray<double>{1, 0, 1, -1}); // b = [1,0,1,-1] /phase
    c.PolarToCart(a, b); // result stored in c = projections to Re and Im axis
}
See Also: Vector::CartToPolar
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtxVec *PolarToCart(TMtxVec *AmpltVec, TMtxVec *PhaseVec, int AIndex, int PIndex, int Index, int Len) const;

Convert AmpltVec elements [AIndex]..[AIndex+Len-1] and PhaseVec elements [PIndex]..[PIndex+Len-1] from polar form (radius,angle) to cartesian form (X,y).

#NameTypeDescription
1AmpltVecTMtxVec *
2PhaseVecTMtxVec *
3AIndexint
4PIndexint
5Indexint
6Lenint
Remarks:

The results are stored as complex numbers (X=Re, y=Im) in the calling object elements [Index]..[Index+Len-1]. Size and Vector::Complex properties of the calling object must be set explicitly. An exception is raised if Vector::ConditionCheck is True and array borders are overrun/underrun.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a, b, c;

    a = {1, 2, 3, 4}; // a = [1,2,3, 4] //magnitude
    b = {1, 0, 1, -1}; // b = [1,0,1,-1] /phase
    c.PolarToCart(a, b); // result stored in c = projections to Re and Im axis
}
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler