1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gamil.com>
3 .\" Distributed under GPL
5 .TH CACOS 3 2011-09-15 "" "Linux Programmer's Manual"
7 cacos, cacosf, cacosl \- complex arc cosine
9 .B #include <complex.h>
11 .BI "double complex cacos(double complex " z );
13 .BI "float complex cacosf(float complex " z );
15 .BI "long double complex cacosl(long double complex " z );
21 function calculates the complex arc cosine of
23 If \fIy\ =\ cacos(z)\fP, then \fIz\ =\ ccos(y)\fP.
26 is chosen in the interval [0,pi].
31 cacos(z) = \-i * clog(z + i * csqrt(1 \- z * z))
34 These functions first appeared in glibc in version 2.1.
39 /* Link with "\-lm" */
47 main(int argc, char *argv[])
49 double complex z, c, f;
53 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
57 z = atof(argv[1]) + atof(argv[2]) * I;
61 printf("cacos() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
63 f = \-i * clog(z + i * csqrt(1 \- z * z));
65 printf("formula = %6.3f %6.3f*i\\n", creal(f), cimag(f));