1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"1038.32">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica
; min-height: 14.0px}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica
}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica
}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; min-height: 12.0px}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; color: #cd1612}
18 p
.p9
{margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco
; color: #ad140d}
19 span
.s1
{font: 18.0px Helvetica
}
20 span
.s2
{text-decoration: underline
; color: #0000ee}
21 span
.s3
{color: #1135f9}
22 span
.s4
{color: #001bb9}
23 span
.s5
{color: #0b28c6}
24 span
.s6
{font: 12.0px Helvetica
}
25 span
.s7
{color: #0b28c5}
26 span
.s8
{font: 9.0px Monaco
}
27 span
.s9
{color: #102bc6}
28 span
.s10
{color: #102ac2}
29 span
.s11
{color: #cd1713}
30 span
.s12
{color: #000000}
31 span
.s13
{color: #102bc5}
32 span
.s14
{color: #606060}
33 span
.Apple-tab-span
{white-space:pre
}
37 <p class=
"p1"><span class=
"s1"><b>Complex
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>complex number
</b></p>
38 <p class=
"p2"><br></p>
39 <p class=
"p1"><b>inherits from:
</b> <a href=
"../Core/Object.html"><span class=
"s2">Object
</span></a> :
<b> </b><a href=
"Magnitude.html"><span class=
"s3">Magnitude
</span></a><span class=
"s3"> :
</span><b> </b><a href=
"Number.html"><span class=
"s4">Number
</span></a></p>
40 <p class=
"p2"><br></p>
41 <p class=
"p1">A class representing complex numbers.
</p>
42 <p class=
"p2"><br></p>
43 <p class=
"p1">Note that this is a simplified representation of a complex number, which does not implement the full mathematical notion of a complex number.
<span class=
"Apple-converted-space"> </span></p>
44 <p class=
"p2"><br></p>
45 <p class=
"p3"><br></p>
46 <p class=
"p4"><b>Creation
</b></p>
47 <p class=
"p3"><br></p>
48 <p class=
"p5"><b>new(real, imag)
</b></p>
49 <p class=
"p3"><br></p>
50 <p class=
"p5"><span class=
"Apple-tab-span"> </span>Create a new complex number with the given real and imaginary parts.
</p>
51 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
52 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>a =
<span class=
"s5">Complex
</span>(
2,
5);
</p>
53 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>a.real;
</p>
54 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>a.imag;
</p>
55 <p class=
"p3"><br></p>
56 <p class=
"p3"><br></p>
57 <p class=
"p4"><b>Accessing
</b></p>
58 <p class=
"p3"><br></p>
59 <p class=
"p5"><b><span class=
"Apple-tab-span"> </span>real
</b></p>
60 <p class=
"p5"><b><span class=
"Apple-tab-span"> </span>real_(val)
</b></p>
61 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
62 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>The real part of the number.
</p>
63 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
64 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>imag
<span class=
"Apple-converted-space"> </span></b></p>
65 <p class=
"p5"><b><span class=
"Apple-tab-span"> </span>imag_(val)
</b></p>
66 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
67 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>The imaginary part of the number.
</p>
68 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
69 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
70 <p class=
"p3"><br></p>
71 <p class=
"p4"><b>Math
</b></p>
72 <p class=
"p3"><br></p>
73 <p class=
"p5"><b><span class=
"Apple-tab-span"> </span>+ aNumber
</b></p>
74 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
75 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex addition.
</p>
76 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
77 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9) +
<span class=
"s7">Complex
</span>(-
6,
2)
</p>
78 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
79 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>- aNumber
</b></p>
80 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
81 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex subtraction.
</p>
82 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
83 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9) -
<span class=
"s7">Complex
</span>(-
6,
2)
</p>
84 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
85 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>* aNumber
</b></p>
86 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
87 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex multiplication.
</p>
88 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
89 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9) *
<span class=
"s7">Complex
</span>(-
6,
2)
</p>
90 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
91 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>/ aNumber
</b></p>
92 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
93 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex division.
</p>
94 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
95 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9) /
<span class=
"s7">Complex
</span>(-
6,
2)
</p>
96 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
97 <p class=
"p5"><span class=
"s8"><span class=
"Apple-tab-span"> </span></span><b>** aNumber
</b></p>
98 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
99 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex exponentiation (not implemented for all combinations - some are mathematically ambiguous).
</p>
100 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
101 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s9">Complex
</span>(
0,
2) **
6</p>
102 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>2.3 **
<span class=
"s5">Complex
</span>(
0,
2)
</p>
103 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s10">Complex
</span>(
2,
9) **
1.2 <span class=
"s11">// not defined
</span></p>
104 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
105 <p class=
"p5"><span class=
"s8"><span class=
"Apple-tab-span"> </span></span><b>exp(aNumber)
</b></p>
106 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
107 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex exponentiation with base
<b>e
</b>.
</p>
108 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
109 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>exp(
<span class=
"s5">Complex
</span>(
2,
9))
</p>
110 <p class=
"p8"><span class=
"s12"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>exp(
</span><span class=
"s5">Complex
</span><span class=
"s12">(
0, pi)) == -
1 </span>// Euler's formula: true
</p>
111 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
112 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>squared
</b></p>
113 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
114 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex self multiplication.
</p>
115 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
116 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>squared(
<span class=
"s7">Complex
</span>(
2,
1))
</p>
117 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
118 <p class=
"p5"><span class=
"s8"><span class=
"Apple-tab-span"> </span></span><b>cubed
</b></p>
119 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
120 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Complex double self multiplication.
</p>
121 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
122 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>squared(
<span class=
"s7">Complex
</span>(
2,
1))
</p>
123 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
124 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
125 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>< aNumber
</b></p>
126 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
127 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the comparison of just the real parts.
</p>
128 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
129 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s5">Complex
</span>(
2,
9)
< <span class=
"s5">Complex
</span>(
5,
1);
</p>
130 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
131 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>== aNumber
</b></p>
132 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
133 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the comparison assuming that the reals (floats) are fully embedded in the complex numbers
<span class=
"Apple-converted-space"> </span></p>
134 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
135 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s5">Complex
</span>(
1,
0) ==
1;
</p>
136 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s5">Complex
</span>(
1,
5) ==
<span class=
"s5">Complex
</span>(
1,
5);
</p>
137 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
138 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>neg
</b></p>
139 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
140 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Negation of both parts.
</p>
141 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
142 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9).neg
</p>
143 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
144 <p class=
"p5"><span class=
"s8"><span class=
"Apple-tab-span"> </span></span><b>abs
</b></p>
145 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
146 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>The absoulte value of a complex number is its magnitude.
</p>
147 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
148 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s13">Complex
</span>(
3,
4).abs
</p>
149 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
150 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>conjugate
</b></p>
151 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
152 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the complex conjugate.
</p>
153 <p class=
"p3"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></p>
154 <p class=
"p7"><span class=
"s6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s7">Complex
</span>(
2,
9).conjugate
</p>
155 <p class=
"p3"><br></p>
156 <p class=
"p3"><br></p>
157 <p class=
"p4"><b>Conversion
</b></p>
158 <p class=
"p3"><br></p>
159 <p class=
"p5"><b><span class=
"Apple-tab-span"> </span>magnitude
</b></p>
160 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
161 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the distance to the origin.
</p>
162 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
163 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>rho
</b></p>
164 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
165 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the distance to the origin.
</p>
166 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
167 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>angle
</b></p>
168 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
169 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the angle in radians.
</p>
170 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
171 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>phase
</b></p>
172 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
173 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the angle in radians.
</p>
174 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
175 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>theta
</b></p>
176 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
177 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer the angle in radians.
</p>
178 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
179 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>asPoint
</b></p>
180 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
181 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Convert to a
<a href=
"../Geometry/Point.html"><span class=
"s3">Point
</span></a>.
</p>
182 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
183 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>asPolar
</b></p>
184 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
185 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Convert to a
<a href=
"Polar.html"><span class=
"s3">Polar
</span></a></p>
186 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
187 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>asInteger
</b></p>
188 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
189 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer real part as
<a href=
"Integer.html"><span class=
"s3">Integer
</span></a>.
</p>
190 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
191 <p class=
"p5"><span class=
"Apple-tab-span"> </span><b>asFloat
</b></p>
192 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
193 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>Answer real part as
<a href=
"Float.html"><span class=
"s3">Float
</span></a>.
</p>
194 <p class=
"p3"><span class=
"Apple-tab-span"> </span></p>
195 <p class=
"p3"><br></p>
196 <p class=
"p3"><br></p>
197 <p class=
"p3"><br></p>
198 <p class=
"p9">// example
</p>
199 <p class=
"p6"><br></p>
200 <p class=
"p7">a =
<span class=
"s4">Complex
</span>(
0,
1);
</p>
201 <p class=
"p9"><span class=
"s12">a * a;
</span>// returns Complex(-
1,
0);
</p>
202 <p class=
"p6"><br></p>
203 <p class=
"p9">// julia set approximation
</p>
204 <p class=
"p7">f = {
<span class=
"s4">|z|
</span> z * z +
<span class=
"s4">Complex
</span>(
0.70176,
0.3842) };
</p>
205 <p class=
"p6"><br></p>
207 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"s4">var
</span> n =
80, xs =
400, ys =
400, dx = xs / n, dy = ys / n, zoom =
3, offset = -
0.5;
</p>
208 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"s4">var
</span> field = {
<span class=
"s4">|x|
</span> {
<span class=
"s4">|y|
</span> <span class=
"s4">Complex
</span>(x / n + offset * zoom, y / n + offset * zoom) } ! n } ! n;
</p>
209 <p class=
"p7"><span class=
"Apple-tab-span"> </span>w =
<span class=
"s4">Window
</span>(
<span class=
"s14">"Julia set"</span>, bounds:
<span class=
"s4">Rect
</span>(
200,
200, xs, ys)).front;
</p>
210 <p class=
"p7"><span class=
"Apple-tab-span"> </span>w.view.background_(
<span class=
"s4">Color
</span>.black);
</p>
211 <p class=
"p6"><span class=
"Apple-tab-span"> </span></p>
212 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>w.drawHook = {
</p>
213 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>n.do {
<span class=
"s4">|x|
</span></p>
214 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>n.do {
<span class=
"s4">|y|
</span></p>
215 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">var
</span> z = field[x][y];
</p>
216 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>z = f.(z);
</p>
217 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>field[x][y] = z;
</p>
218 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">Pen
</span>.color =
<span class=
"s4">Color
</span>.gray(z.rho.linlin(-
100,
100,
1,
0));
</p>
219 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-converted-space"> </span></p>
220 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">Pen
</span>.addRect(
</p>
221 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">Rect
</span>(x * dx, y * dy, dx, dy)
</p>
222 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>);
</p>
223 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"s4">Pen
</span>.fill
</p>
224 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>}
</p>
225 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>}
</p>
226 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>};
</p>
227 <p class=
"p7"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>fork({
6.do { w.refresh;
2.wait } },
<span class=
"s4">AppClock
</span>)
</p>
229 <p class=
"p6"><br></p>
230 <p class=
"p6"><br></p>
231 <p class=
"p6"><br></p>
232 <p class=
"p3"><br></p>