Debian Codegraph @

upstream/debian-unstable/man3/catan.3

raw
1 '\" t
2 .\" Copyright 2002, Walter Harms <[email protected]>
3 .\" Copyright 2011, Michael Kerrisk <[email protected]>
4 .\" Copyright, the authors of the Linux man-pages project
5 .\"
6 .\" SPDX-License-Identifier: GPL-1.0-or-later
7 .\"
8 .TH catan 3 2026-02-08 "Linux man-pages 6.18"
9 .SH NAME
10 catan, catanf, catanl \- complex arc tangents
11 .SH LIBRARY
12 Math library
13 .RI ( libm ,\~ \-lm )
14 .SH SYNOPSIS
15 .nf
16 .B #include <complex.h>
17 .P
18 .BI "double complex catan(double complex " z );
19 .BI "float complex catanf(float complex " z );
20 .BI "long double complex catanl(long double complex " z );
21 .fi
22 .SH DESCRIPTION
23 These functions calculate the complex arc tangent of
24 .IR z .
25 If
26 .IR "y\ =\ catan(z)" ,
27 then
28 .IR "z\ =\ ctan(y)" .
29 The real part of
30 .I y
31 is chosen in the interval [\-pi/2, pi/2].
32 .P
33 One has:
34 .P
35 .in +4n
36 .EX
37 catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
38 .EE
39 .in
40 .SH ATTRIBUTES
41 For an explanation of the terms used in this section, see
42 .BR attributes (7).
43 .TS
44 allbox;
45 lbx lb lb
46 l l l.
47 Interface Attribute Value
48 T{
49 .na
50 .nh
51 .BR catan (),
52 .BR catanf (),
53 .BR catanl ()
54 T} Thread safety MT-Safe
55 .TE
56 .SH STANDARDS
57 C11, POSIX.1-2008.
58 .SH HISTORY
59 glibc 2.1.
60 C99, POSIX.1-2001.
61 .SH EXAMPLES
62 .\" SRC BEGIN (catan.c)
63 .EX
64 /* Link with "\-lm" */
65 \&
66 #include <complex.h>
67 #include <stdio.h>
68 #include <stdlib.h>
69 #include <unistd.h>
70 \&
71 int
72 main(int argc, char *argv[])
73 {
74 double complex z, c, f;
75 double complex i = I;
76 \&
77 if (argc != 3) {
78 fprintf(stderr, "Usage: %s <real> <imag>\[rs]n", argv[0]);
79 exit(EXIT_FAILURE);
80 }
81 \&
82 z = atof(argv[1]) + atof(argv[2]) * I;
83 \&
84 c = catan(z);
85 printf("catan() = %6.3f %6.3f*i\[rs]n", creal(c), cimag(c));
86 \&
87 f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
88 printf("formula = %6.3f %6.3f*i\[rs]n", creal(f), cimag(f));
89 \&
90 exit(EXIT_SUCCESS);
91 }
92 .EE
93 .\" SRC END
94 .SH SEE ALSO
95 .BR ccos (3),
96 .BR clog (3),
97 .BR ctan (3),
98 .BR complex (7)