Previous Page
Next Page

ctan

Calculates the tangent of a complex number

#include <complex.h>
double complex ctan ( double complex z  );
float complex ctanf ( float complex z  );
long double complex ctanl ( long double complex z  );

The ctan( ) function returns the tangent of its complex number argument z, which is equal to sin(z) / cos(z).

Example

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 x I.
Using the csin( ) and ccos( ) functions yields -0.37 +0.67 x I.

See Also

csin( ), ccos( ), cacos( ), casin( ), catan( )


Previous Page
Next Page