]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
c05ed63a | 2 | .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gamil.com> |
2297bf0e | 3 | .\" |
38f20bb9 | 4 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 5 | .\" Distributed under GPL |
38f20bb9 | 6 | .\" %%%LICENSE_END |
fea681da | 7 | .\" |
4c3fa19d | 8 | .TH CATAN 3 2011-09-15 "" "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> | |
13 | .sp | |
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 ); |
fea681da | 19 | .sp |
20c58d70 | 20 | Link with \fI\-lm\fP. |
fea681da | 21 | .SH DESCRIPTION |
b5cc2ffb MK |
22 | The |
23 | .BR catan () | |
41783353 MK |
24 | function calculates the complex arc tangent of |
25 | .IR z . | |
26 | If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP. | |
8c383102 | 27 | The real part of y is chosen in the interval [\-pi/2,pi/2]. |
fea681da | 28 | .LP |
41783353 MK |
29 | One has: |
30 | .nf | |
31 | ||
4c3fa19d | 32 | catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i) |
41783353 | 33 | .fi |
f0d7ce1d MK |
34 | .SH VERSIONS |
35 | These functions first appeared in glibc in version 2.1. | |
3ff79ea9 MS |
36 | .SH ATTRIBUTES |
37 | For an explanation of the terms used in this section, see | |
38 | .BR attributes (7). | |
39 | .TS | |
40 | allbox; | |
41 | lbw28 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 | |
47297adb | 50 | .SH CONFORMING TO |
44a2c328 | 51 | C99. |
c05ed63a MK |
52 | .SH EXAMPLE |
53 | .nf | |
54 | /* Link with "\-lm" */ | |
55 | ||
56 | #include <complex.h> | |
57 | #include <stdlib.h> | |
58 | #include <unistd.h> | |
59 | #include <stdio.h> | |
60 | ||
61 | int | |
62 | main(int argc, char *argv[]) | |
63 | { | |
64 | double complex z, c, f; | |
65 | double complex i = I; | |
66 | ||
67 | if (argc != 3) { | |
68 | fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]); | |
69 | exit(EXIT_FAILURE); | |
70 | } | |
71 | ||
72 | z = atof(argv[1]) + atof(argv[2]) * I; | |
73 | ||
74 | c = catan(z); | |
75 | printf("catan() = %6.3f %6.3f*i\\n", creal(c), cimag(c)); | |
76 | ||
77 | f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i); | |
78 | printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2)); | |
79 | ||
80 | exit(EXIT_SUCCESS); | |
81 | } | |
82 | .fi | |
47297adb | 83 | .SH SEE ALSO |
fea681da MK |
84 | .BR ccos (3), |
85 | .BR clog (3), | |
5be56312 | 86 | .BR ctan (3), |
a8bda636 | 87 | .BR complex (7) |