OSDN Git Service

495adc2df768673609080f6d0491c56a5ce5edf1
[linuxjm/LDP_man-pages.git] / draft / man7 / complex.7
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\"
4 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
5 .\"         all rights reserved.
6 .\" Translated 2003-08-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
7 .\" Updated 2005-02-20, Akihiro MOTOKI
8 .\"
9 .\"WORD:        operations      演算
10 .\"WORD:        imaginary unit  虚数単位
11 .\"
12 .TH COMPLEX 7 2011-09-16 "" "Linux Programmer's Manual"
13 .\"O .SH NAME
14 .SH 名前
15 .\"O complex \- basics of complex mathematics
16 complex \- 複素数の数学の基礎
17 .\"O .SH SYNOPSIS
18 .SH 書式
19 .B #include <complex.h>
20 .\"O .SH DESCRIPTION
21 .SH 説明
22 .\"O Complex numbers are numbers of the form z = a+b*i, where a and b are
23 .\"O real numbers and i = sqrt(\-1), so that i*i = \-1.
24 複素数は z = a+b*i の形式の数である。 a と b は実数であり、
25 i は i = sqrt(\-1) つまり i*i = \-1 の関係を満たす。
26 .br
27 .\"O There are other ways to represent that number.
28 .\"O The pair (a,b) of real
29 .\"O numbers may be viewed as a point in the plane, given by X- and
30 .\"O Y-coordinates.
31 .\"O This same point may also be described by giving
32 .\"O the pair of real numbers (r,phi), where r is the distance to the origin O,
33 .\"O and phi the angle between the X-axis and the line Oz.
34 .\"O Now
35 .\"O z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)).
36 複素数を表現する別の方法もある。実数の組 (a,b) は X座標、Y座標で
37 指定された平面上の点と見ることができる。この同じ点は、実数の組
38 (r,phi) で表すこともできる。r は原点 0 からの距離であり、phi は
39 X軸と 0 と z を結ぶ線分がなす角である。このとき、
40 z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi))
41 の関係が成り立つ。
42 .PP
43 .\"O The basic operations are defined on z = a+b*i and w = c+d*i as:
44 2つの複素数 z = a+b*i, w = c+d*i に関する基本演算は次のように定義される:
45 .TP
46 .\"O .B addition: z+w = (a+c) + (b+d)*i
47 .B 加法: z+w = (a+c) + (b+d)*i
48 .TP
49 .\"O .B multiplication: z*w = (a*c \- b*d) + (a*d + b*c)*i
50 .B 乗法: z*w = (a*c \- b*d) + (a*d + b*c)*i
51 .TP
52 .\"O .B division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i
53 .B 除法: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i
54 .PP
55 .\"O Nearly all math function have a complex counterpart but there are
56 .\"O some complex-only functions.
57 ほとんど全ての数学関数に関して複素数版があるが、
58 複素数専用の関数も幾つかある。
59 .\"O .SH EXAMPLE
60 .SH 例
61 .\"O Your C-compiler can work with complex numbers if it supports the C99 standard.
62 .\"O Link with \fI\-lm\fP.
63 .\"O The imaginary unit is represented by I.
64 使用する C コンパイラが C99 標準をサポートしていれば複素数を使うことができる。
65 \fI\-lm\fP をつけてリンクすること。虚数単位は I で表現される。
66 .sp
67 .nf
68 .\"O /* check that exp(i * pi) == \-1 */
69 /* exp(i * pi) == \-1 となることを確認する */
70 #include <math.h>        /* for atan */
71 #include <stdio.h>
72 #include <complex.h>
73
74 int
75 main(void)
76 {
77     double pi = 4 * atan(1.0);
78     double complex z = cexp(I * pi);
79     printf("%f + %f * i\\n", creal(z), cimag(z));
80 }
81 .fi
82 .\"O .SH "SEE ALSO"
83 .SH 関連項目
84 .BR cabs (3),
85 .BR cacos (3),
86 .BR cacosh (3),
87 .BR carg (3),
88 .BR casin (3),
89 .BR casinh (3),
90 .BR catan (3),
91 .BR catanh (3),
92 .BR ccos (3),
93 .BR ccosh (3),
94 .BR cerf (3),
95 .BR cexp (3),
96 .BR cexp2 (3),
97 .BR cimag (3),
98 .BR clog (3),
99 .BR clog10 (3),
100 .BR clog2 (3),
101 .BR conj (3),
102 .BR cpow (3),
103 .BR cproj (3),
104 .BR creal (3),
105 .BR csin (3),
106 .BR csinh (3),
107 .BR csqrt (3),
108 .BR ctan (3),
109 .BR ctanh (3)