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 CATAN 3 2021-03-22 "" "Linux Programmer's Manual"
10 catan, catanf, catanl \- complex arc tangents
13 .B #include <complex.h>
15 .BI "double complex catan(double complex " z );
16 .BI "float complex catanf(float complex " z );
17 .BI "long double complex catanl(long double complex " z );
22 These functions calculate the complex arc tangent of
24 If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP.
25 The real part of y is chosen in the interval [\-pi/2,pi/2].
30 catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
33 These functions first appeared in glibc in version 2.1.
35 For an explanation of the terms used in this section, see
43 Interface Attribute Value
48 T} Thread safety MT-Safe
54 C99, POSIX.1-2001, POSIX.1-2008.
57 /* Link with "\-lm" */
65 main(int argc, char *argv[])
67 double complex z, c, f;
71 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
75 z = atof(argv[1]) + atof(argv[2]) * I;
78 printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
80 f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
81 printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));