]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/catan.3
catan.3: ATTRIBUTES: Note functions that are thread-safe
[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.\"
4c3fa19d 8.TH CATAN 3 2011-09-15 "" "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
b5cc2ffb
MK
22The
23.BR catan ()
41783353
MK
24function calculates the complex arc tangent of
25.IR z .
26If \fIy\ =\ catan(z)\fP, then \fIz\ =\ ctan(y)\fP.
8c383102 27The real part of y is chosen in the interval [\-pi/2,pi/2].
fea681da 28.LP
41783353
MK
29One 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
35These functions first appeared in glibc in version 2.1.
3ff79ea9
MS
36.SH ATTRIBUTES
37For an explanation of the terms used in this section, see
38.BR attributes (7).
39.TS
40allbox;
41lbw28 lb lb
42l l l.
43Interface Attribute Value
44T{
45.BR catan (),
46.BR catanf (),
47.BR catanl ()
48T} Thread safety MT-Safe
49.TE
47297adb 50.SH CONFORMING TO
44a2c328 51C99.
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
61int
62main(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)