catan


catan

Calculates the inverse tangent of a complex number

 #include <complex.h> double complex catan ( double complex z  ); float complex catanf ( float complex z  ); long double complex catanl ( double long complex z  ); 

The catan( ) functions accept a complex number as their argument and return a complex number, but otherwise work the same as atan( ).

Example

 double complex v, w, z ; double a = 0.0, b = 0.0; puts("Enter the real and imaginary parts of a complex number:"); if ( scanf("%lf %lf", &a, &b) == 2) {   z = a + b * I;   printf( "z = %.2f %+.2f*I.\n", creal(z), cimag(z) );   v = catan(z);   w = catanh(z);   printf( "z is the tangent of %.2f %+.2f*I\n",  creal(v), cimag(v) );   printf( "and the hyperbolic tangent of %.2f %+.2f*I.\n",           creal(w), cimag(w) ); } else   printf("Invalid input. \n"); 

This code produces output like the following:

 Enter the real and imaginary parts of a complex number: 30 30 z = 30.00 +30.00*I. z is the tangent of 1.55 +0.02*I and the hyperbolic tangent of 0.02 +1.55*I. 

See Also

ccos( ), csin( ), ctan( ), cacos( ), casin( )



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