clMatrix::PolarToCart Method

Overload List

#SignatureDescription
1TOpenCLMtxVec *PolarToCart(TOpenCLMtxVec *AmpltVec, TOpenCLMtxVec *PhaseVec) const;Converts the polar magnitude/phase pairs to cartesian pairs.
2TOpenCLMtxVec *PolarToCart(TOpenCLMtxVec *AmpltVec, TOpenCLMtxVec *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: TOpenCLMtxVec *PolarToCart(TOpenCLMtxVec *AmpltVec, TOpenCLMtxVec *PhaseVec) const;

Converts the polar magnitude/phase pairs to cartesian pairs.

#NameTypeDescription
1AmpltVecTOpenCLMtxVec *
2PhaseVecTOpenCLMtxVec *
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 clMatrix::Complex properties of the calling object are set implicitly to match AmpltVec and PhaseVec objects.

Examples
#include "clMtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

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

    a.CopyFromArray(2, 2, DewArray<float>{1, 2, 3, 4}); // a = [1,2,3, 4] //magnitude
    b.CopyFromArray(2, 2, DewArray<float>{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: clMatrix::CartToPolar
Declared in Dew::Math::clMatrix · Dew.Math/clMtxExpr.h · Cross-compiler

Overload 2: TOpenCLMtxVec *PolarToCart(TOpenCLMtxVec *AmpltVec, TOpenCLMtxVec *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
1AmpltVecTOpenCLMtxVec *
2PhaseVecTOpenCLMtxVec *
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 clMatrix::Complex properties of the calling object must be set explicitly. An exception is raised if array borders are overrun/underrun.

Declared in Dew::Math::clMatrix · Dew.Math/clMtxExpr.h · Cross-compiler