ToPolar1D

AnalysisLibErrType ToPolar1D (double arrayXReal[], double arrayXImg[], int numberOfElements, double magnitude[], double phase[]);

Purpose

Converts the set of rectangular coordinate points (arrayXReal, arrayXImg) to a set of polar coordinate points (magnitude, phase). ToPolar1D obtains the element of the polar coordinate set using the following formulas:



The phase value is in the range [– : ].

ToPolar1D can perform the operations in place; that is, the input and output arrays can be the same.

Parameters

Input
Name Type Description
arrayXReal double-precision array Real part of the rectangular coordinates to convert to polar coordinates.
arrayXImg double-precision array Imaginary part of the rectangular coordinates to convert to polar coordinates.
numberOfElements integer Number of elements to convert.
Output
Name Type Description
magnitude double-precision array Magnitude of the resulting polar coordinates.
phase double-precision array Phase, in radians, of the resulting polar coordinates.

Phase values are in the range from -infinity to +infinity.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.