]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/catan.3
signal.7: Note async-signal-safe functions added by POSIX.1-2008 TC1
[thirdparty/man-pages.git] / man3 / catan.3
CommitLineData
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.\"
c73595c2 8.TH CATAN 3 2015-04-19 "" "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>
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 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].
fea681da 26.LP
41783353
MK
27One has:
28.nf
29
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
MK
50.SH EXAMPLE
51.nf
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) {
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}
80.fi
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)