You are here: Symbol Reference > clMtxVec Namespace > Classes > TOpenCLMtxVec Class > public > CartToPolar Method > TOpenCLMtxVec.CartToPolar Method (TOpenCLMtxVec, TOpenCLMtxVec)
MtxVec VCL
ContentsIndex
PreviousUpNext
TOpenCLMtxVec.CartToPolar Method (TOpenCLMtxVec, TOpenCLMtxVec)

Converts elements from cartesian to polar coordinate form.

Pascal
procedure CartToPolar(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec); overload;

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.ComplexComplexproperty must be true. If this is not the case, an exception is raised. Size and TOpenCLBase.ComplexComplexproperties of AmpltVec and PhaseVec are set automatically.

var A,Amplt,Phase: TOpenCLMatrix; begin CreateIt(A,Amplt,Phase); try A.SetIt(2,2,True,[1,0, 2,0 2,0 4,1)); // 2x2, complex matrix A.CartToPolar(Amplt,Phase); finally FreeIt(A,Amplt,Phase); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!