]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catan.3
4ba8802260238a5c9ce76136759d4efc8354e68d
[thirdparty/man-pages.git] / man3 / catan.3
1 '\" t
2 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .TH catan 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 catan, catanf, catanl \- complex arc tangents
10 .SH LIBRARY
11 Math library
12 .RI ( libm ", " \-lm )
13 .SH SYNOPSIS
14 .nf
15 .B #include <complex.h>
16 .PP
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 );
20 .fi
21 .SH DESCRIPTION
22 These functions calculate the complex arc tangent of
23 .IR z .
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].
26 .PP
27 One has:
28 .PP
29 .in +4n
30 .EX
31 catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
32 .EE
33 .in
34 .SH ATTRIBUTES
35 For an explanation of the terms used in this section, see
36 .BR attributes (7).
37 .ad l
38 .nh
39 .TS
40 allbox;
41 lbx lb lb
42 l l l.
43 Interface Attribute Value
44 T{
45 .BR catan (),
46 .BR catanf (),
47 .BR catanl ()
48 T} Thread safety MT-Safe
49 .TE
50 .hy
51 .ad
52 .sp 1
53 .SH STANDARDS
54 C11, POSIX.1-2008.
55 .SH HISTORY
56 glibc 2.1.
57 C99, POSIX.1-2001.
58 .SH EXAMPLES
59 .\" SRC BEGIN (catan.c)
60 .EX
61 /* Link with "\-lm" */
62 \&
63 #include <complex.h>
64 #include <stdio.h>
65 #include <stdlib.h>
66 #include <unistd.h>
67 \&
68 int
69 main(int argc, char *argv[])
70 {
71 double complex z, c, f;
72 double complex i = I;
73 \&
74 if (argc != 3) {
75 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
76 exit(EXIT_FAILURE);
77 }
78 \&
79 z = atof(argv[1]) + atof(argv[2]) * I;
80 \&
81 c = catan(z);
82 printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
83 \&
84 f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
85 printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
86 \&
87 exit(EXIT_SUCCESS);
88 }
89 .EE
90 .\" SRC END
91 .SH SEE ALSO
92 .BR ccos (3),
93 .BR clog (3),
94 .BR ctan (3),
95 .BR complex (7)