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

Converts the polar magnitude/phase pairs to cartesian pairs.

Pascal
function PolarToCart(const AmpltVec: TOpenCLMtxVec; const PhaseVec: TOpenCLMtxVec): TOpenCLMtxVec; overload;

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

var a,b,c: TOpenCLVector; begin CreateIt(a,b,c); try 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 finally FreeIt(a,b,c); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!