December 2005
Beginner to intermediate
618 pages
20h 19m
English
cacosh
Calculates the inverse hyperbolic cosine of a complex number
#include <complex.h> double complexcacosh( double complexz); float complexcacoshf( float complexz); long double complexcacoshl( long double complexz);
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
[-πi, +πi].
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");Read now
Unlock full access