clVector.PolarToCart Method

Overload List

#SignatureDescription
1function PolarToCart(AmpltVec: TOpenCLMtxVec; PhaseVec: TOpenCLMtxVec): TOpenCLMtxVec;Converts the polar magnitude/phase pairs to cartesian pairs.
2function PolarToCart(AmpltVec: TOpenCLMtxVec; PhaseVec: TOpenCLMtxVec; AIndex: Integer; PIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;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: function PolarToCart(AmpltVec: TOpenCLMtxVec; PhaseVec: TOpenCLMtxVec): TOpenCLMtxVec;

Converts the polar magnitude/phase pairs to cartesian pairs.

#NameTypeDescription
1AmpltVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2PhaseVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix

Result: stored in self (calling object), returns self for chaining

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 clVector.Complex properties of the calling object are set implicitly to match AmpltVec and PhaseVec objects.

Examples
var a,b,c: clVector;
begin
    a.CopyFromArray(TSingleArray.Create(1,2,3,4));  // a = [1,2,3, 4] //magnitude
    b.CopyFromArray(TSingleArray.Create(1,0,1,-1)); // b = [1,0,1,-1] /phase
    c.PolarToCart(a,b); // result stored in c = projections to Re and Im axis
end;
See Also: clVector.CartToPolar

Overload 2: function PolarToCart(AmpltVec: TOpenCLMtxVec; PhaseVec: TOpenCLMtxVec; AIndex: Integer; PIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

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
1AmpltVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2PhaseVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
3AIndexIntegerstart index
4PIndexInteger
5IndexIntegerstart index
6LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

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