December 2005
Beginner to intermediate
618 pages
20h 19m
English
ctan
Calculates the tangent of a complex number
#include <complex.h> double complexctan( double complexz); float complexctanf( float complexz); long double complexctanl( long double complexz);
The ctan() function returns
the tangent of its complex number argument
z, which is equal to
sin(z) /
cos(z).
double complex z = − 0.53 + 0.62 * I;
double complex c, d;
c = ctan( z );
d = csin( z ) / ccos( z );
printf("The ctan() function returns %.2f %+.2f \xD7 I.\n",
creal(c), cimag(c) );
printf("Using the csin() and ccos() functions yields %.2f %+.2f \xD7 I.\n",
creal(d), cimag(d) );This code produces the following output:
The ctan() function returns -0.37 +0.67 × I. Using the csin() and ccos() functions yields -0.37 +0.67 × I.
Read now
Unlock full access