fractals 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +66 -0
- data/Rakefile +65 -0
- data/doc/classes/Fractals.html +169 -0
- data/doc/classes/Fractals/Algorithms.html +125 -0
- data/doc/classes/Fractals/BurningShip.html +172 -0
- data/doc/classes/Fractals/Fractal.html +261 -0
- data/doc/classes/Fractals/Julia.html +171 -0
- data/doc/classes/Fractals/Mandelbrot.html +172 -0
- data/doc/classes/Fractals/Newton.html +173 -0
- data/doc/classes/Fractals/Renderers.html +118 -0
- data/doc/classes/Fractals/Renderers/Base.html +496 -0
- data/doc/classes/Fractals/Renderers/JRubyRenderer.html +178 -0
- data/doc/classes/Fractals/Renderers/PNGRenderer.html +202 -0
- data/doc/classes/Fractals/Renderers/RMagickRenderer.html +210 -0
- data/doc/classes/Fractals/Themes.html +131 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +180 -0
- data/doc/files/examples_rb.html +122 -0
- data/doc/files/gpl-2_0_txt.html +522 -0
- data/doc/files/lib/fractals/algorithms_rb.html +90 -0
- data/doc/files/lib/fractals/renderers_rb.html +104 -0
- data/doc/files/lib/fractals/themes_rb.html +90 -0
- data/doc/files/lib/fractals_rb.html +114 -0
- data/doc/fr_class_index.html +49 -0
- data/doc/fr_file_index.html +37 -0
- data/doc/fr_method_index.html +57 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples.rb +101 -0
- data/gpl-2.0.txt +339 -0
- data/lib/fractals.rb +105 -0
- data/lib/fractals/algorithms.rb +35 -0
- data/lib/fractals/renderers.rb +169 -0
- data/lib/fractals/themes.rb +48 -0
- data/test/burning_ship_test.rb +19 -0
- data/test/julia_test.rb +20 -0
- data/test/mandelbrot_test.rb +19 -0
- data/test/newton_test.rb +20 -0
- data/test/renderer_test.rb +21 -0
- metadata +104 -0
@@ -0,0 +1,261 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: Fractals::Fractal [Ruby Fractal Library - 1.2.0]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">Fractals::Fractal</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/fractals_rb.html">
|
57
|
+
|
58
|
+
lib/fractals.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
<a href="Renderers/Base.html">
|
74
|
+
|
75
|
+
Renderers::Base
|
76
|
+
|
77
|
+
</a>
|
78
|
+
|
79
|
+
</td>
|
80
|
+
</tr>
|
81
|
+
|
82
|
+
</table>
|
83
|
+
</div>
|
84
|
+
<!-- banner header -->
|
85
|
+
|
86
|
+
<div id="bodyContent">
|
87
|
+
|
88
|
+
<div id="contextContent">
|
89
|
+
|
90
|
+
<div id="description">
|
91
|
+
<p>
|
92
|
+
The <a href="Fractal.html">Fractal</a> base class.
|
93
|
+
</p>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<div id="method-list">
|
101
|
+
<h3 class="section-bar">Methods</h3>
|
102
|
+
|
103
|
+
<div class="name-list">
|
104
|
+
|
105
|
+
<a href="#M000013">iterate</a>
|
106
|
+
|
107
|
+
<a href="#M000012">new</a>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<!-- if includes -->
|
115
|
+
|
116
|
+
<div id="section">
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<div id="attribute-list">
|
121
|
+
<h3 class="section-bar">Attributes</h3>
|
122
|
+
|
123
|
+
<div class="name-list">
|
124
|
+
<table>
|
125
|
+
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">args</td>
|
128
|
+
|
129
|
+
<td class="context-item-value"> [RW] </td>
|
130
|
+
|
131
|
+
<td class="context-item-desc">
|
132
|
+
A Hash of arguments used in the fractal’s expression.
|
133
|
+
|
134
|
+
</td>
|
135
|
+
</tr>
|
136
|
+
|
137
|
+
<tr class="top-aligned-row context-row">
|
138
|
+
<td class="context-item-name">c</td>
|
139
|
+
|
140
|
+
<td class="context-item-value"> [RW] </td>
|
141
|
+
|
142
|
+
<td class="context-item-desc">
|
143
|
+
The complex number seed.
|
144
|
+
|
145
|
+
</td>
|
146
|
+
</tr>
|
147
|
+
|
148
|
+
<tr class="top-aligned-row context-row">
|
149
|
+
<td class="context-item-name">expression</td>
|
150
|
+
|
151
|
+
<td class="context-item-value"> [RW] </td>
|
152
|
+
|
153
|
+
<td class="context-item-desc">
|
154
|
+
The fractal’s expression as a block.
|
155
|
+
|
156
|
+
</td>
|
157
|
+
</tr>
|
158
|
+
|
159
|
+
</table>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
<!-- if method_list -->
|
165
|
+
|
166
|
+
<div id="methods">
|
167
|
+
|
168
|
+
<h3 class="section-bar">Public Class methods</h3>
|
169
|
+
|
170
|
+
|
171
|
+
<div id="method-M000012" class="method-detail">
|
172
|
+
<a name="M000012"></a>
|
173
|
+
|
174
|
+
<div class="method-heading">
|
175
|
+
|
176
|
+
<a href="#M000012" class="method-signature">
|
177
|
+
|
178
|
+
<span class="method-name">new</span><span class="method-args">(c, args, &expression)</span>
|
179
|
+
|
180
|
+
</a>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
|
186
|
+
<p>
|
187
|
+
Sets the default property values.
|
188
|
+
</p>
|
189
|
+
|
190
|
+
<p><a class="source-toggle" href="#"
|
191
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
192
|
+
<div class="method-source-code" id="M000012-source">
|
193
|
+
<pre>
|
194
|
+
<span class="ruby-comment cmt"># File lib/fractals.rb, line 46</span>
|
195
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">c</span>, <span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">expression</span>)
|
196
|
+
<span class="ruby-ivar">@c</span>, <span class="ruby-ivar">@args</span>, <span class="ruby-ivar">@expression</span> = <span class="ruby-identifier">c</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">expression</span>
|
197
|
+
<span class="ruby-keyword kw">super</span>()
|
198
|
+
<span class="ruby-keyword kw">end</span>
|
199
|
+
</pre>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
|
206
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
207
|
+
|
208
|
+
|
209
|
+
<div id="method-M000013" class="method-detail">
|
210
|
+
<a name="M000013"></a>
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
|
214
|
+
<a href="#M000013" class="method-signature">
|
215
|
+
|
216
|
+
<span class="method-name">iterate</span><span class="method-args">(n) {|i, @args[:z]| ...}</span>
|
217
|
+
|
218
|
+
</a>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
|
224
|
+
<p>
|
225
|
+
Iterates the fractal’s expression <b>n</b> times yielding the
|
226
|
+
iteration number and result.
|
227
|
+
</p>
|
228
|
+
|
229
|
+
<p><a class="source-toggle" href="#"
|
230
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
231
|
+
<div class="method-source-code" id="M000013-source">
|
232
|
+
<pre>
|
233
|
+
<span class="ruby-comment cmt"># File lib/fractals.rb, line 53</span>
|
234
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">iterate</span>(<span class="ruby-identifier">n</span>)
|
235
|
+
<span class="ruby-ivar">@args</span>[<span class="ruby-identifier">:z</span>] = <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">:c</span>]
|
236
|
+
<span class="ruby-identifier">n</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
237
|
+
<span class="ruby-ivar">@expression</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@args</span>)
|
238
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">i</span>, <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">:z</span>]
|
239
|
+
<span class="ruby-keyword kw">end</span>
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
241
|
+
</pre>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div id="validator-badges">
|
257
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</body>
|
261
|
+
</html>
|
@@ -0,0 +1,171 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: Fractals::Julia [Ruby Fractal Library - 1.2.0]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">Fractals::Julia</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/fractals_rb.html">
|
57
|
+
|
58
|
+
lib/fractals.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
<a href="Fractal.html">
|
74
|
+
|
75
|
+
Fractals::Fractal
|
76
|
+
|
77
|
+
</a>
|
78
|
+
|
79
|
+
</td>
|
80
|
+
</tr>
|
81
|
+
|
82
|
+
</table>
|
83
|
+
</div>
|
84
|
+
<!-- banner header -->
|
85
|
+
|
86
|
+
<div id="bodyContent">
|
87
|
+
|
88
|
+
<div id="contextContent">
|
89
|
+
|
90
|
+
<div id="description">
|
91
|
+
<p>
|
92
|
+
The <a href="Julia.html">Julia</a> set fractal.
|
93
|
+
</p>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<div id="method-list">
|
101
|
+
<h3 class="section-bar">Methods</h3>
|
102
|
+
|
103
|
+
<div class="name-list">
|
104
|
+
|
105
|
+
<a href="#M000015">new</a>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<!-- if includes -->
|
113
|
+
|
114
|
+
<div id="section">
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<!-- if method_list -->
|
120
|
+
|
121
|
+
<div id="methods">
|
122
|
+
|
123
|
+
<h3 class="section-bar">Public Class methods</h3>
|
124
|
+
|
125
|
+
|
126
|
+
<div id="method-M000015" class="method-detail">
|
127
|
+
<a name="M000015"></a>
|
128
|
+
|
129
|
+
<div class="method-heading">
|
130
|
+
|
131
|
+
<a href="#M000015" class="method-signature">
|
132
|
+
|
133
|
+
<span class="method-name">new</span><span class="method-args">(c=Complex(0.36, 0.1))</span>
|
134
|
+
|
135
|
+
</a>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="method-description">
|
140
|
+
|
141
|
+
<p><a class="source-toggle" href="#"
|
142
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000015-source">
|
144
|
+
<pre>
|
145
|
+
<span class="ruby-comment cmt"># File lib/fractals.rb, line 74</span>
|
146
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">c</span>=<span class="ruby-constant">Complex</span>(<span class="ruby-value">0</span><span class="ruby-value">.36</span>, <span class="ruby-value">0</span><span class="ruby-value">.1</span>))
|
147
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">c</span>, {<span class="ruby-identifier">:p</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
148
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:z</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:z</span>]<span class="ruby-operator">**</span><span class="ruby-identifier">args</span>[<span class="ruby-identifier">:p</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">c</span>
|
149
|
+
<span class="ruby-keyword kw">end</span>
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
151
|
+
</pre>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div id="validator-badges">
|
167
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
</body>
|
171
|
+
</html>
|
@@ -0,0 +1,172 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: Fractals::Mandelbrot [Ruby Fractal Library - 1.2.0]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">Fractals::Mandelbrot</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/fractals_rb.html">
|
57
|
+
|
58
|
+
lib/fractals.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
<a href="Fractal.html">
|
74
|
+
|
75
|
+
Fractals::Fractal
|
76
|
+
|
77
|
+
</a>
|
78
|
+
|
79
|
+
</td>
|
80
|
+
</tr>
|
81
|
+
|
82
|
+
</table>
|
83
|
+
</div>
|
84
|
+
<!-- banner header -->
|
85
|
+
|
86
|
+
<div id="bodyContent">
|
87
|
+
|
88
|
+
<div id="contextContent">
|
89
|
+
|
90
|
+
<div id="description">
|
91
|
+
<p>
|
92
|
+
Benoît Mandelbrot’s <a href="Mandelbrot.html">Mandelbrot</a> set
|
93
|
+
fractal.
|
94
|
+
</p>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<div id="method-list">
|
102
|
+
<h3 class="section-bar">Methods</h3>
|
103
|
+
|
104
|
+
<div class="name-list">
|
105
|
+
|
106
|
+
<a href="#M000016">new</a>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<!-- if includes -->
|
114
|
+
|
115
|
+
<div id="section">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<!-- if method_list -->
|
121
|
+
|
122
|
+
<div id="methods">
|
123
|
+
|
124
|
+
<h3 class="section-bar">Public Class methods</h3>
|
125
|
+
|
126
|
+
|
127
|
+
<div id="method-M000016" class="method-detail">
|
128
|
+
<a name="M000016"></a>
|
129
|
+
|
130
|
+
<div class="method-heading">
|
131
|
+
|
132
|
+
<a href="#M000016" class="method-signature">
|
133
|
+
|
134
|
+
<span class="method-name">new</span><span class="method-args">(c=Complex(-0.65, 0.0))</span>
|
135
|
+
|
136
|
+
</a>
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div class="method-description">
|
141
|
+
|
142
|
+
<p><a class="source-toggle" href="#"
|
143
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
144
|
+
<div class="method-source-code" id="M000016-source">
|
145
|
+
<pre>
|
146
|
+
<span class="ruby-comment cmt"># File lib/fractals.rb, line 83</span>
|
147
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">c</span>=<span class="ruby-constant">Complex</span>(<span class="ruby-value">-0</span><span class="ruby-value">.65</span>, <span class="ruby-value">0</span><span class="ruby-value">.0</span>))
|
148
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">c</span>, {<span class="ruby-identifier">:z</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>, <span class="ruby-identifier">:p</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
149
|
+
<span class="ruby-identifier">args</span>[<span class="ruby-identifier">:z</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:z</span>]<span class="ruby-operator">**</span><span class="ruby-identifier">args</span>[<span class="ruby-identifier">:p</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:c</span>]
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div id="validator-badges">
|
168
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
</body>
|
172
|
+
</html>
|