]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/catan.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / catan.3
CommitLineData
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 9catan, catanf, catanl \- complex arc tangents
2af19291
AC
10.SH LIBRARY
11Math 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 22These functions calculate the complex arc tangent of
41783353 23.IR z .
1ae6b2c7 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
1ae6b2c7
AC
29.in +4n
30.EX
31catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
32.EE
33.in
3ff79ea9
MS
34.SH ATTRIBUTES
35For an explanation of the terms used in this section, see
36.BR attributes (7).
37.TS
38allbox;
c466875e 39lbx lb lb
3ff79ea9 40l l l.
2672f89d 41Interface Attribute Value
3ff79ea9 42T{
9e54434e
BR
43.na
44.nh
3ff79ea9
MS
45.BR catan (),
46.BR catanf (),
47.BR catanl ()
2672f89d 48T} Thread safety MT-Safe
3ff79ea9 49.TE
c466875e 50.sp 1
3113c7f3 51.SH STANDARDS
4131356c
AC
52C11, POSIX.1-2008.
53.SH HISTORY
54glibc 2.1.
55C99, 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
66int
67main(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)