2 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
7 .TH catan 3 (date) "Linux man-pages (unreleased)"
9 catan, catanf, catanl \- complex arc tangents
12 .RI ( libm ", " \-lm )
15 .B #include <complex.h>
17 .BI "double complex catan(double complex " z );
18 .BI "float complex catanf(float complex " z );
19 .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].
31 catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
35 For an explanation of the terms used in this section, see
41 Interface Attribute Value
48 T} Thread safety MT-Safe
56 .\" SRC BEGIN (catan.c)
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));