C Programming/complex.h/ccos

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Prototypes[edit | edit source]

double complex cacos(double complex z);
float complex cacosf(float complex z);
long double complex cacosl(long double complex z);

Description[edit | edit source]

The C library provides with the ccos function which gives the cosine of a complex number.It is included in the header file complex.h. This function returns a double-precision floating point number.
The ccos function can be expressed as:

ccosz = (exp (i * z) + exp (-i * z))/2[1]

References[edit | edit source]

  1. "ccos(3) - Linux man page". die.net. Retrieved 20 September 2011.