cproj


cproj

Calculates the projection of a complex number on the Riemann sphere

 #include <complex.h> double complex cproj ( double complex z  ); float complex cprojf ( float complex z  ); long double complex cprojl ( long double complex z  ); 

The Riemann sphere is a surface that represents the entire complex plane and one point for infinity. The cproj( ) function yields the representation of a complex number on the Riemann sphere. The value of cproj(z) is equal to z, except in cases where the real or complex part of z is infinite. In all such cases, the real part of the result is infinity, and the imaginary part is zero with the sign of the imaginary part of the argument z.

Example

 double complex z = -INFINITY - 2.7 * I; double complex c = cproj(z); printf("%.2f %+.2f * I is projected to %.2f %+.2f * I.\n",        creal(z), cimag(z), creal(c), cimag(c)); 

This code produces the following output:

 -inf -2.70 * I is projected to inf -0.00 * I. 

See Also

cabs( ), cimag( ), creal( ), carg( ), conj( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net