Vector.CartToPolar Method

Overload List

#SignatureDescription
1void CartToPolar(TMtxVec AmpltVec, TMtxVec PhaseVec)Converts elements from cartesian to polar coordinate form.
2void CartToPolar(TMtxVec AmpltVec, TMtxVec PhaseVec, Int32 AmpltIndex, Int32 PhaseIndex, Int32 Index, Int32 Len)Convert calling object elements [Index] to [Index+Len-1] from cartesian to polar form.

Overload 1: void CartToPolar(TMtxVec AmpltVec, TMtxVec PhaseVec)

Converts elements from cartesian to polar coordinate form.

#NameTypeDescription
1AmpltVecTMtxVecsource TVec or TMtx
2PhaseVecTMtxVecsource TVec or TMtx

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 Dew.Math.Vector.Complex property must be true. If this is not the case, an exception is raised. Size and Dew.Math.Vector.Complex properties of AmpltVec and PhaseVec are set automatically.

Examples
Vector A;
Vector Amplt;
Vector Phase;
A.SetIt(2,true,[1,0, 2,0
2,0  4,1]);

A.CartToPolar(Amplt,Phase);
See Also: Vector.PolarToCart

Overload 2: void CartToPolar(TMtxVec AmpltVec, TMtxVec PhaseVec, Int32 AmpltIndex, Int32 PhaseIndex, Int32 Index, Int32 Len)

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

#NameTypeDescription
1AmpltVecTMtxVecsource TVec or TMtx
2PhaseVecTMtxVecsource TVec or TMtx
3AmpltIndexInt32
4PhaseIndexInt32
5IndexInt32start index
6LenInt32element count

Result: stored in self (calling object)

Remarks:

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