File: complex.7

package info (click to toggle)
manpages-ja 0.5.0.0.20080615-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 20,508 kB
  • ctags: 1
  • sloc: sh: 13,690; perl: 157; makefile: 114
file content (60 lines) | stat: -rw-r--r-- 1,727 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\"
.\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
.\"         all rights reserved.
.\" Translated 2003-08-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-02-20, Akihiro MOTOKI
.\"
.\"WORD:	operations	黻
.\"WORD:	imaginary unit	ñ
.\"
.TH COMPLEX 7 2002-07-28 "" "Linux Programmer's Manual"
.SH ̾
complex \- ʣǿοؤδ
.SH 
.B #include <complex.h>
.SH 
ʣǿ z = a+b*i ηοǤ롣 a  b ϼ¿Ǥꡢ
i  i = sqrt(\-1) Ĥޤ i*i = \-1 δط
.br
ʣǿɽ̤ˡ⤢롣¿ (a,b)  XɸYɸ
ꤵ줿ʿ̾ȸ뤳ȤǤ롣Ʊϡ¿
(r,phi) ɽȤǤ롣r ϸ 0 εΥǤꡢphi 
X 0  z ʬʤѤǤ롣ΤȤ
z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi))
δطΩġ
.PP
2Ĥʣǿ z = a+b*i, w = c+d*i ˴ؤܱ黻ϼΤ褦:
.TP
.B ˡ: z+w = (a+c) + (b+d)*i
.TP
.B ˡ: z*w = (a*c \- b*d) + (a*d + b*c)*i
.TP
.B ˡ: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c \- a*d)/(c*c + d*d))*i
.PP
ۤȤƤοشؿ˴ؤʣǿǤ뤬
ʣǿѤδؿĤ롣
.SH 
Ѥ C ѥ餬 C99 ɸ򥵥ݡȤƤʣǿȤȤǤ롣
\fI\-lm\fP Ĥƥ󥯤뤳ȡñ̤ I ɽ롣
.sp
.nf
/* exp(i * pi) == \-1 Ȥʤ뤳Ȥǧ */
#include <math.h>        /* for atan */
#include <complex.h>

int
main(void)
{
    double pi = 4 * atan(1.0);
    complex z = cexp(I * pi);
    printf("%f + %f * i\\n", creal(z), cimag(z));
}
.fi
.SH Ϣ
.BR cabs (3),
.BR carg (3),
.BR cexp (3),
.BR cimag (3),
.BR creal (3)