Previous Page
Next Page

ctanh

Calculates the hyperbolic tangent of a complex number

#include <complex.h>
double complex ctanh ( double complex z  );
float complex ctanhf ( float complex z  );
long double complex ctanhl ( long double complex z  );

The hyperbolic tangent of a complex number z is equal to sinh(z) / cosh(z). The ctanh functions return the hyperbolic tangent of their complex argument.

Example

double complex v, w, z =  -0.5 + 1.23 * I;

v = ctanh( z );
w = csinh( z ) / ccosh( z );

printf("The ctanh( ) function returns %.2f %+.2f*I.\n", creal(v), cimag(v) );
printf("Using the csinh( ) and ccosh( ) functions yields %.2f %+.2f*I.\n",
        creal(w), cimag(w) );

This code produces the following output:

The ctanh( ) function returns -1.53 +0.82*I.
Using the csinh( ) and ccosh( ) functions yields -1.53 +0.82*I.

See Also

ccosh( ), csinh( ), cacosh( ), casinh( ), catanh( )


Previous Page
Next Page