1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
8 .TH CACOS 3 2021-03-22 "" "Linux Programmer's Manual"
10 cacos, cacosf, cacosl \- complex arc cosine
13 .B #include <complex.h>
15 .BI "double complex cacos(double complex " z );
16 .BI "float complex cacosf(float complex " z );
17 .BI "long double complex cacosl(long double complex " z );
22 These functions calculate the complex arc cosine of
24 If \fIy\ =\ cacos(z)\fP, then \fIz\ =\ ccos(y)\fP.
27 is chosen in the interval [0,pi].
32 cacos(z) = \-i * clog(z + i * csqrt(1 \- z * z))
35 These functions first appeared in glibc in version 2.1.
37 For an explanation of the terms used in this section, see
45 Interface Attribute Value
50 T} Thread safety MT-Safe
56 C99, POSIX.1-2001, POSIX.1-2008.
59 /* Link with "\-lm" */
67 main(int argc, char *argv[])
69 double complex z, c, f;
73 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
77 z = atof(argv[1]) + atof(argv[2]) * I;
81 printf("cacos() = %6.3f %6.3f*i\en", creal(c), cimag(c));
83 f = \-i * clog(z + i * csqrt(1 \- z * z));
85 printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));