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

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