TOpenCLValue.PolarToCart Method

TOpenCLValue PolarToCart(TOpenCLValue AmpltVec, TOpenCLValue PhaseVec)

Converts the polar magnitude/phase pair to cartesian pair.

#NameTypeDescription
1AmpltVecTOpenCLValuesource TOpenCLValue
2PhaseVecTOpenCLValuesource TOpenCLValue

Returns: TOpenCLValue

Remarks:

Converts AmpltVec and PhaseVec values (combined) from polar to cartesian form. The result is stored as a complex number (x=Re, y=Im) in to the calling object. FloatPrecision and Dew.Math.TOpenCLBase.Complex properties of the calling object are set implicitly to match AmpltVec and PhaseVec objects.

Examples
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        TOpenCLValue a,b,c;
        clMtxVec.CreateIt(out a, out b, out c);
        try
        {
            a.Copy(2);  // a = [2] //magnitude
            b.Copy(3); // b = [1] /phase
            c.PolarToCart(a,b); // result stored in c = projections to Re and Im axis
        }
        finally
        {
            clMtxVec.FreeIt(ref a, ref b, ref c);
        }
    }
}
See Also: TOpenCLValue.CartToPolar