]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da | 2 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
cd2c21a0 | 3 | .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com> |
2297bf0e | 4 | .\" |
95fb8859 | 5 | .\" SPDX-License-Identifier: GPL-1.0-or-later |
fea681da | 6 | .\" |
4c1c5274 | 7 | .TH catan 3 (date) "Linux man-pages (unreleased)" |
fea681da | 8 | .SH NAME |
c13182ef | 9 | catan, catanf, catanl \- complex arc tangents |
2af19291 AC |
10 | .SH LIBRARY |
11 | Math library | |
8fc3b2cf | 12 | .RI ( libm ", " \-lm ) |
fea681da | 13 | .SH SYNOPSIS |
c7db92b9 | 14 | .nf |
fea681da | 15 | .B #include <complex.h> |
68e4db0a | 16 | .PP |
c13182ef | 17 | .BI "double complex catan(double complex " z ); |
c13182ef | 18 | .BI "float complex catanf(float complex " z ); |
c13182ef | 19 | .BI "long double complex catanl(long double complex " z ); |
c7db92b9 | 20 | .fi |
fea681da | 21 | .SH DESCRIPTION |
5600f73a | 22 | These functions calculate the complex arc tangent of |
41783353 | 23 | .IR z . |
1ae6b2c7 | 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 |
1ae6b2c7 AC |
29 | .in +4n |
30 | .EX | |
31 | catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i) | |
32 | .EE | |
33 | .in | |
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; | |
c466875e | 39 | lbx lb lb |
3ff79ea9 | 40 | l l l. |
2672f89d | 41 | Interface Attribute Value |
3ff79ea9 | 42 | T{ |
9e54434e BR |
43 | .na |
44 | .nh | |
3ff79ea9 MS |
45 | .BR catan (), |
46 | .BR catanf (), | |
47 | .BR catanl () | |
2672f89d | 48 | T} Thread safety MT-Safe |
3ff79ea9 | 49 | .TE |
c466875e | 50 | .sp 1 |
3113c7f3 | 51 | .SH STANDARDS |
4131356c AC |
52 | C11, POSIX.1-2008. |
53 | .SH HISTORY | |
54 | glibc 2.1. | |
55 | C99, POSIX.1-2001. | |
a14af333 | 56 | .SH EXAMPLES |
b0b6ab4e | 57 | .\" SRC BEGIN (catan.c) |
207050fa | 58 | .EX |
c05ed63a | 59 | /* Link with "\-lm" */ |
fe5dba13 | 60 | \& |
c05ed63a | 61 | #include <complex.h> |
ad3868f0 | 62 | #include <stdio.h> |
c05ed63a MK |
63 | #include <stdlib.h> |
64 | #include <unistd.h> | |
fe5dba13 | 65 | \& |
c05ed63a MK |
66 | int |
67 | main(int argc, char *argv[]) | |
68 | { | |
69 | double complex z, c, f; | |
70 | double complex i = I; | |
fe5dba13 | 71 | \& |
c05ed63a | 72 | if (argc != 3) { |
d1a71985 | 73 | fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]); |
c05ed63a MK |
74 | exit(EXIT_FAILURE); |
75 | } | |
fe5dba13 | 76 | \& |
c05ed63a | 77 | z = atof(argv[1]) + atof(argv[2]) * I; |
fe5dba13 | 78 | \& |
c05ed63a | 79 | c = catan(z); |
d1a71985 | 80 | printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c)); |
fe5dba13 | 81 | \& |
c05ed63a | 82 | f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i); |
716f16ae | 83 | printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f)); |
fe5dba13 | 84 | \& |
c05ed63a MK |
85 | exit(EXIT_SUCCESS); |
86 | } | |
207050fa | 87 | .EE |
b0b6ab4e | 88 | .\" SRC END |
47297adb | 89 | .SH SEE ALSO |
fea681da MK |
90 | .BR ccos (3), |
91 | .BR clog (3), | |
5be56312 | 92 | .BR ctan (3), |
a8bda636 | 93 | .BR complex (7) |