Adelsbach/VSIPL
Core Programming Reference Guide
DD-00016-015
Core

This manual is preliminary and incomplete.
While our Core implementation implements all functions given in the standard we are still working on completing this documentation.

Please refer to the VSIPL standard for a complete function reference of the Core profile until we have completed work on this documentation.

2.1.5 vsip_polar_p - Convert Cartesian to Polar Coordinates

void vsip_polar_f(vsip_cscalar_f a, vsip_scalar_f *radius, vsip_scalar_f *theta);
Description

This function converts a complex scalar from Cartesian coordinates (real and imaginary parts) to polar coordinates (magnitude and phase angle).

The function computes both the magnitude (radius) and phase angle (theta) of the complex number:

            √︃------2--------2
radius= |a|=  real(a) +imag(a)

theta=atan2(imag(a),real(a))

The phase angle is returned in radians in the range [- π,π].

Parameters