OSDN Git Service

9774fe2a7c1a23633581853429169e99ea1cd2f7
[linuxjm/LDP_man-pages.git] / release / man3 / catan.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gamil.com>
3 .\" Distributed under GPL
4 .\"
5 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
6 .\"         all rights reserved.
7 .\" Translated Thu Jul 24 00:22:25 JST 2003
8 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
9 .\"
10 .\"WORD:        arc sine        µÕÀµ¸¹
11 .\"WORD:        arc cosine      µÕ;¸¹
12 .\"WORD:        arc tangent     µÕÀµÀÜ
13 .\"WORD:        real part       ¼ÂÉô
14 .\"WORD:        imaginary part  µõÉô
15 .\"
16 .TH CATAN 3 2011-09-15 "" "Linux Programmer's Manual"
17 .SH Ì¾Á°
18 catan, catanf, catanl \- Ê£ÁÇ¿ô¤ÎµÕÀµÀÜ (arc tangent)
19 .SH ½ñ¼°
20 .B #include <complex.h>
21 .sp
22 .BI "double complex catan(double complex " z );
23 .br
24 .BI "float complex catanf(float complex " z );
25 .br
26 .BI "long double complex catanl(long double complex " z );
27 .sp
28 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
29 .SH ÀâÌÀ
30 .BR catan ()
31 ´Ø¿ô¤ÏÊ£ÁÇ¿ô
32 .I z
33 ¤ÎµÕÀµÀÜ (arc tangent) ¤ò·×»»¤¹¤ë¡£
34 \fIy = catan(z)\fP ¤Ê¤é¤Ð¡¢ \fIz = ctan(y)\fP ¤¬À®Î©¤¹¤ë¡£
35 .I y
36 ¤Î¼ÂÉô¤ÎÃͤ϶è´Ö [\-pi/2,pi/2] ¤«¤éÁªÂò¤µ¤ì¤ë¡£
37 .LP
38 ¼¡¤Î´Ø·¸¤¬À®Î©¤¹¤ë:
39 .nf
40
41     catan(z) = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i)
42 .fi
43 .SH ¥Ð¡¼¥¸¥ç¥ó
44 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
45 .SH ½àµò
46 C99.
47 .SH Îã
48 .nf
49 /* Link with "\-lm" */
50
51 #include <complex.h>
52 #include <stdlib.h>
53 #include <unistd.h>
54 #include <stdio.h>
55
56 int
57 main(int argc, char *argv[])
58 {
59     double complex z, c, f;
60     double complex i = I;
61
62     if (argc != 3) {
63         fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
64         exit(EXIT_FAILURE);
65     }
66
67     z = atof(argv[1]) + atof(argv[2]) * I;
68
69     c = catan(z);
70     printf("catan() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
71
72     f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
73     printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
74
75     exit(EXIT_SUCCESS);
76 }
77 .fi
78 .SH ´ØÏ¢¹àÌÜ
79 .BR ccos (3),
80 .BR clog (3),
81 .BR ctan (3),
82 .BR complex (7)