cacosh


cacosh

Calculates the inverse hyperbolic cosine of a complex number

 #include <complex.h> double complex cacosh ( double complex z  ); float complex cacoshf ( float complex z  ); long double complex cacoshl ( long double complex z  ); 

The cacosh( ) functions return the complex number whose hyperbolic cosine is equal to the argument z. The real part of the return value is non-negative; the imaginary part is in the interval [-pi, +pi].

Example

 double complex v, z ; double a = 0.0, b = 0.0; puts("Calculate the inverse hyperbolic cosine of a complex number,"      " cacosh(z)\n"); 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 = cacosh(z);   printf( "The cacosh(z) function yields %.2f %+.2f*I.\n",           creal(v), cimag(v) );   printf( "The inverse function, ccosh(cacosh(z)), yields %.2f %+.2f*I.\n",           creal( ccosh(v)), cimag( ccosh(v)) ); } else   printf("Invalid input.\n"); 

See Also

Other hyperbolic trigonometry functions for complex numbers: casinh( ), catanh( ), csinh( ), ccosh( ), and ctanh( ); the hyperbolic cosine and inverse hyperbolic cosine functions for real numbers: cosh( ) and acosh( )



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