]>
Commit | Line | Data |
---|---|---|
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 | .\" |
c73595c2 | 8 | .TH CACOSH 3 2015-04-19 "" "Linux Programmer's Manual" |
fea681da MK |
9 | .SH NAME |
10 | cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine | |
11 | .SH SYNOPSIS | |
12 | .B #include <complex.h> | |
68e4db0a | 13 | .PP |
c13182ef | 14 | .BI "double complex cacosh(double complex " z ); |
d39541ec | 15 | .br |
fea681da | 16 | .BI "float complex cacoshf(float complex " z ); |
d39541ec | 17 | .br |
fea681da | 18 | .BI "long double complex cacoshl(long double complex " z ); |
68e4db0a | 19 | .PP |
20c58d70 | 20 | Link with \fI\-lm\fP. |
fea681da | 21 | .SH DESCRIPTION |
5600f73a | 22 | These functions calculate the complex arc hyperbolic cosine of |
80f1c436 MK |
23 | .IR z . |
24 | If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP. | |
25 | The imaginary part of | |
26 | .I y | |
27 | is chosen in the interval [\-pi,pi]. | |
28 | The real part of | |
29 | .I y | |
2fda57bd | 30 | is chosen nonnegative. |
dd3568a1 | 31 | .PP |
f262c004 | 32 | One has: |
207050fa | 33 | .PP |
80f1c436 | 34 | .nf |
4c3fa19d | 35 | cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2)) |
80f1c436 | 36 | .fi |
f0d7ce1d MK |
37 | .SH VERSIONS |
38 | These functions first appeared in glibc in version 2.1. | |
318c528f MS |
39 | .SH ATTRIBUTES |
40 | For an explanation of the terms used in this section, see | |
41 | .BR attributes (7). | |
42 | .TS | |
43 | allbox; | |
44 | lbw30 lb lb | |
45 | l l l. | |
46 | Interface Attribute Value | |
47 | T{ | |
48 | .BR cacosh (), | |
49 | .BR cacoshf (), | |
50 | .BR cacoshl () | |
51 | T} Thread safety MT-Safe | |
52 | .TE | |
47297adb | 53 | .SH CONFORMING TO |
9a74e018 | 54 | C99, POSIX.1-2001, POSIX.1-2008. |
8b57a223 | 55 | .SH EXAMPLE |
207050fa | 56 | .EX |
8b57a223 MK |
57 | /* Link with "\-lm" */ |
58 | ||
59 | #include <complex.h> | |
60 | #include <stdlib.h> | |
61 | #include <unistd.h> | |
62 | #include <stdio.h> | |
63 | ||
64 | int | |
65 | main(int argc, char *argv[]) | |
66 | { | |
67 | double complex z, c, f; | |
68 | ||
69 | if (argc != 3) { | |
70 | fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]); | |
71 | exit(EXIT_FAILURE); | |
72 | } | |
73 | ||
74 | z = atof(argv[1]) + atof(argv[2]) * I; | |
75 | ||
76 | c = cacosh(z); | |
77 | printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c)); | |
78 | ||
79 | f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2)); | |
80 | printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2)); | |
81 | ||
82 | exit(EXIT_SUCCESS); | |
83 | } | |
207050fa | 84 | .EE |
47297adb | 85 | .SH SEE ALSO |
fea681da MK |
86 | .BR acosh (3), |
87 | .BR cabs (3), | |
5be56312 | 88 | .BR ccosh (3), |
fea681da | 89 | .BR cimag (3), |
a8bda636 | 90 | .BR complex (7) |