TOpenCLVector.CartToPolar Method

Overload List

#SignatureDescription
1procedure CartToPolar(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec);Converts elements from cartesian to polar coordinate form.
2procedure CartToPolar(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec; AmpltIndex: Integer; PhaseIndex: Integer; Index: Integer; Len: Integer);Convert calling object elements [Index] to [Index+Len-1] from cartesian to polar form.

Overload 1: procedure CartToPolar(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec);

Converts elements from cartesian to polar coordinate form.

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

Result: stored in self (calling object)

Remarks:

Converts all calling object elements from cartesian to polar coordinate form, storing the magnitude (radius) component of corresponding elements in the AmpltVec and the phase (angle) component of corresponding elements in the PhaseVec. If you want to use this method then the calling matrix TOpenCLBase.Complex property must be true. If this is not the case, an exception is raised. Size and TOpenCLBase.Complex properties of AmpltVec and PhaseVec are set automatically.

Examples
var A,Amplt,Phase: clVector;
begin
    A.CopyCplxFromArray(TSingleArray.Create(1,0, 2,0, 2,0  4,1));  // 4, complex matrix
    A.CartToPolar(Amplt,Phase);
end;

Overload 2: procedure CartToPolar(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec; AmpltIndex: Integer; PhaseIndex: Integer; Index: Integer; Len: Integer);

Convert calling object elements [Index] to [Index+Len-1] from cartesian to polar form.

#NameTypeDescription
1AmpltVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
2PhaseVecTOpenCLMtxVecsource TOpenCLVector or TOpenCLMatrix
3AmpltIndexInteger
4PhaseIndexInteger
5IndexIntegerstart index
6LenIntegerelement count

Result: stored in self (calling object)

Remarks:

Store the results in AmpltVec (radius values) and PhaseVec(phase values). Size and TOpenCLBase.Complex properties of the calling vector must be set explicitly. An exception is raised if array borders are overrun or underrun.