File: complex.chapt.txt

package info (click to toggle)
yacas 1.3.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 7,176 kB
  • ctags: 3,520
  • sloc: cpp: 13,960; java: 12,602; sh: 11,401; makefile: 552; perl: 517; ansic: 381
file content (160 lines) | stat: -rw-r--r-- 2,504 bytes parent folder | download | duplicates (5)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

			Complex numbers

*INTRO Yacas understands the concept of a complex number,
and has a few functions that allow manipulation of complex
numbers.

*CMD Complex --- construct a complex number
*STD
*CALL
	Complex(r, c)

*PARMS

{r} -- real part

{c} -- imaginary part

*DESC

This function represents the complex number "r + I*c", where "I"
is the imaginary unit. It is the standard representation used in Yacas
to represent complex numbers. Both "r" and "c" are supposed to be
real.

Note that, at the moment, many functions in Yacas assume that all
numbers are real unless it is obvious that it is a complex
number. Hence {Im(Sqrt(x))} evaluates to {0} which is only true for nonnegative "x".

*E.G.

	In> I
	Out> Complex(0,1);
	In> 3+4*I
	Out> Complex(3,4);
	In> Complex(-2,0)
	Out> -2;

*SEE Re, Im, I, Abs, Arg

*CMD Re --- real part of a complex number
*STD
*CALL
	Re(x)

*PARMS

{x} -- argument to the function

*DESC

This function returns the real part of the complex number "x".

*E.G.

	In> Re(5)
	Out> 5;
	In> Re(I)
	Out> 0;
	In> Re(Complex(3,4))
	Out> 3;

*SEE Complex, Im

*CMD Im --- imaginary part of a complex number
*STD
*CALL
	Im(x)

*PARMS

{x} -- argument to the function

*DESC

This function returns the imaginary part of the complex number "x".

*E.G.

	In> Im(5)
	Out> 0;
	In> Im(I)
	Out> 1;
	In> Im(Complex(3,4))
	Out> 4;

*SEE Complex, Re

*CMD I --- imaginary unit
*STD
*CALL
	I

*DESC

This symbol represents the imaginary unit, which equals the square
root of -1. It evaluates to {Complex(0,1)}.

*E.G.

	In> I
	Out> Complex(0,1);
	In> I = Sqrt(-1)
	Out> True;

*SEE Complex

*CMD Conjugate --- complex conjugate
*STD
*CALL
	Conjugate(x)

*PARMS

{x} -- argument to the function

*DESC

This function returns the complex conjugate of "x". The complex
conjugate of $a + I*b$ is $a - I*b$. This function assumes that all
unbound variables are real.

*E.G.

	In> Conjugate(2)
	Out> 2;
	In> Conjugate(Complex(a,b))
	Out> Complex(a,-b);

*SEE Complex, Re, Im

*CMD Arg --- argument of a complex number
*STD
*CALL
	Arg(x)

*PARMS

{x} -- argument to the function

*DESC

This function returns the argument of "x". The argument is the angle
with the positive real axis in the Argand diagram, or the angle
"phi" in the polar representation $r * Exp(I*phi)$ of "x". The
result is in the range ($-Pi$, $Pi$], that is, excluding $-Pi$ but including $Pi$. The
argument of 0 is {Undefined}.

*E.G.

	In> Arg(2)
	Out> 0;
	In> Arg(-1)
	Out> Pi;
	In> Arg(1+I)
	Out> Pi/4;

*SEE Abs, Sign