1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .TH CATAN 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
8 catan, catanf, catanl \- complex arc tangents
11 .RI ( libm ", " \-lm )
14 .B #include <complex.h>
16 .BI "double complex catan(double complex " z );
17 .BI "float complex catanf(float complex " z );
18 .BI "long double complex catanl(long double complex " z );
21 These functions calculate the complex arc tangent of
23 If \fIy\~=\~catan(z)\fP, then \fIz\~=\~ctan(y)\fP.
24 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)
34 These functions first appeared in glibc in version 2.1.
36 For an explanation of the terms used in this section, see
44 Interface Attribute Value
49 T} Thread safety MT-Safe
55 C99, POSIX.1-2001, POSIX.1-2008.
58 /* Link with "\-lm" */
66 main(int argc, char *argv[])
68 double complex z, c, f;
72 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
76 z = atof(argv[1]) + atof(argv[2]) * I;
79 printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
81 f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
82 printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));