]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
cd2c21a0 | 2 | .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com> |
2297bf0e | 3 | .\" |
38f20bb9 | 4 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 5 | .\" Distributed under GPL |
38f20bb9 | 6 | .\" %%%LICENSE_END |
fea681da | 7 | .\" |
c73595c2 | 8 | .TH CATAN 3 2015-04-19 "" "Linux Programmer's Manual" |
fea681da | 9 | .SH NAME |
c13182ef | 10 | catan, catanf, catanl \- complex arc tangents |
fea681da MK |
11 | .SH SYNOPSIS |
12 | .B #include <complex.h> | |
68e4db0a | 13 | .PP |
c13182ef | 14 | .BI "double complex catan(double complex " z ); |
d39541ec | 15 | .br |
c13182ef | 16 | .BI "float complex catanf(float complex " z ); |
d39541ec | 17 | .br |
c13182ef | 18 | .BI "long double complex catanl(long double complex " z ); |
68e4db0a | 19 | .PP |
20c58d70 | 20 | Link with \fI\-lm\fP. |
fea681da | 21 | .SH DESCRIPTION |
5600f73a | 22 | These functions calculate the complex arc tangent of |
41783353 MK |
23 | .IR z . |
24 | If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP. | |
8c383102 | 25 | The real part of y is chosen in the interval [\-pi/2,pi/2]. |
dd3568a1 | 26 | .PP |
41783353 | 27 | One has: |
207050fa | 28 | .PP |
41783353 | 29 | .nf |
4c3fa19d | 30 | catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i) |
41783353 | 31 | .fi |
f0d7ce1d MK |
32 | .SH VERSIONS |
33 | These functions first appeared in glibc in version 2.1. | |
3ff79ea9 MS |
34 | .SH ATTRIBUTES |
35 | For an explanation of the terms used in this section, see | |
36 | .BR attributes (7). | |
37 | .TS | |
38 | allbox; | |
2672f89d | 39 | lbw27 lb lb |
3ff79ea9 | 40 | l l l. |
2672f89d | 41 | Interface Attribute Value |
3ff79ea9 MS |
42 | T{ |
43 | .BR catan (), | |
44 | .BR catanf (), | |
45 | .BR catanl () | |
2672f89d | 46 | T} Thread safety MT-Safe |
3ff79ea9 | 47 | .TE |
47297adb | 48 | .SH CONFORMING TO |
9a74e018 | 49 | C99, POSIX.1-2001, POSIX.1-2008. |
c05ed63a | 50 | .SH EXAMPLE |
207050fa | 51 | .EX |
c05ed63a MK |
52 | /* Link with "\-lm" */ |
53 | ||
54 | #include <complex.h> | |
55 | #include <stdlib.h> | |
56 | #include <unistd.h> | |
57 | #include <stdio.h> | |
58 | ||
59 | int | |
60 | main(int argc, char *argv[]) | |
61 | { | |
62 | double complex z, c, f; | |
63 | double complex i = I; | |
64 | ||
65 | if (argc != 3) { | |
66 | fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]); | |
67 | exit(EXIT_FAILURE); | |
68 | } | |
69 | ||
70 | z = atof(argv[1]) + atof(argv[2]) * I; | |
71 | ||
72 | c = catan(z); | |
73 | printf("catan() = %6.3f %6.3f*i\\n", creal(c), cimag(c)); | |
74 | ||
75 | f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i); | |
76 | printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2)); | |
77 | ||
78 | exit(EXIT_SUCCESS); | |
79 | } | |
207050fa | 80 | .EE |
47297adb | 81 | .SH SEE ALSO |
fea681da MK |
82 | .BR ccos (3), |
83 | .BR clog (3), | |
5be56312 | 84 | .BR ctan (3), |
a8bda636 | 85 | .BR complex (7) |