]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/catan.3
Start of man-pages-5.03: renaming .Announce and .lsm files
[thirdparty/man-pages.git] / man3 / catan.3
CommitLineData
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.\"
9ba01802 8.TH CATAN 3 2019-03-06 "" "Linux Programmer's Manual"
fea681da 9.SH NAME
c13182ef 10catan, 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 20Link with \fI\-lm\fP.
fea681da 21.SH DESCRIPTION
5600f73a 22These functions calculate the complex arc tangent of
41783353
MK
23.IR z .
24If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP.
8c383102 25The real part of y is chosen in the interval [\-pi/2,pi/2].
dd3568a1 26.PP
41783353 27One 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
33These functions first appeared in glibc in version 2.1.
3ff79ea9
MS
34.SH ATTRIBUTES
35For an explanation of the terms used in this section, see
36.BR attributes (7).
37.TS
38allbox;
2672f89d 39lbw27 lb lb
3ff79ea9 40l l l.
2672f89d 41Interface Attribute Value
3ff79ea9
MS
42T{
43.BR catan (),
44.BR catanf (),
45.BR catanl ()
2672f89d 46T} Thread safety MT-Safe
3ff79ea9 47.TE
47297adb 48.SH CONFORMING TO
9a74e018 49C99, 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
59int
60main(int argc, char *argv[])
61{
62 double complex z, c, f;
63 double complex i = I;
64
65 if (argc != 3) {
d1a71985 66 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
c05ed63a
MK
67 exit(EXIT_FAILURE);
68 }
69
70 z = atof(argv[1]) + atof(argv[2]) * I;
71
72 c = catan(z);
d1a71985 73 printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
c05ed63a
MK
74
75 f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
d1a71985 76 printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
c05ed63a
MK
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)