Class: Fractals::Mandelbrot
- Inherits:
-
Fractal
- Object
- Renderers::Base
- Fractal
- Fractals::Mandelbrot
- Defined in:
- lib/fractals.rb
Overview
Benoît Mandelbrot’s Mandelbrot set fractal.
Instance Attribute Summary
Attributes inherited from Fractal
Attributes inherited from Renderers::Base
#algorithm, #bailout, #height, #last_iteration, #magnification, #max_iterations, #set_color, #theme, #width
Instance Method Summary collapse
-
#initialize(c = Complex(-0.65, 0.0)) ⇒ Mandelbrot
constructor
A new instance of Mandelbrot.
Methods inherited from Fractal
Methods inherited from Renderers::Base
acts_as_renderer, #in_set?, #render, #renderer=, #where_is?
Constructor Details
#initialize(c = Complex(-0.65, 0.0)) ⇒ Mandelbrot
Returns a new instance of Mandelbrot.
83 84 85 86 87 |
# File 'lib/fractals.rb', line 83 def initialize(c=Complex(-0.65, 0.0)) super(c, {:z => 0, :p => 2}) do |args| args[:z] = args[:z]**args[:p] + args[:c] end end |