1CATAN(3) Linux Programmer's Manual CATAN(3)
2
3
4
6 catan, catanf, catanl - complex arc tangents
7
9 #include <complex.h>
10
11 double complex catan(double complex z);
12 float complex catanf(float complex z);
13 long double complex catanl(long double complex z);
14
15 Link with -lm.
16
18 These functions calculate the complex arc tangent of z. If
19 y = catan(z), then z = ctan(y). The real part of y is chosen in the
20 interval [-pi/2,pi/2].
21
22 One has:
23
24 catan(z) = (clog(1 + i * z) - clog(1 - i * z)) / (2 * i)
25
27 These functions first appeared in glibc in version 2.1.
28
30 For an explanation of the terms used in this section, see
31 attributes(7).
32
33 ┌────────────────────────────┬───────────────┬─────────┐
34 │Interface │ Attribute │ Value │
35 ├────────────────────────────┼───────────────┼─────────┤
36 │catan(), catanf(), catanl() │ Thread safety │ MT-Safe │
37 └────────────────────────────┴───────────────┴─────────┘
39 C99, POSIX.1-2001, POSIX.1-2008.
40
42 /* Link with "-lm" */
43
44 #include <complex.h>
45 #include <stdlib.h>
46 #include <unistd.h>
47 #include <stdio.h>
48
49 int
50 main(int argc, char *argv[])
51 {
52 double complex z, c, f;
53 double complex i = I;
54
55 if (argc != 3) {
56 fprintf(stderr, "Usage: %s <real> <imag>\n", argv[0]);
57 exit(EXIT_FAILURE);
58 }
59
60 z = atof(argv[1]) + atof(argv[2]) * I;
61
62 c = catan(z);
63 printf("catan() = %6.3f %6.3f*i\n", creal(c), cimag(c));
64
65 f = (clog(1 + i * z) - clog(1 - i * z)) / (2 * i);
66 printf("formula = %6.3f %6.3f*i\n", creal(f2), cimag(f2));
67
68 exit(EXIT_SUCCESS);
69 }
70
72 ccos(3), clog(3), ctan(3), complex(7)
73
75 This page is part of release 5.04 of the Linux man-pages project. A
76 description of the project, information about reporting bugs, and the
77 latest version of this page, can be found at
78 https://www.kernel.org/doc/man-pages/.
79
80
81
82 2019-03-06 CATAN(3)