December 2005
Beginner to intermediate
618 pages
20h 19m
English
ctanh
Calculates the hyperbolic tangent of a complex number
#include <complex.h> double complexctanh( double complexz); float complexctanhf( float complexz); long double complexctanhl( long double complexz);
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.
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.
Read now
Unlock full access