Class: Fractals::Julia

Inherits:
Fractal show all
Defined in:
lib/fractals.rb

Overview

The Julia set fractal.

Instance Attribute Summary

Attributes inherited from Fractal

#args, #c, #expression

Attributes inherited from Renderers::Base

#algorithm, #bailout, #height, #last_iteration, #magnification, #max_iterations, #set_color, #theme, #width

Instance Method Summary collapse

Methods inherited from Fractal

#iterate

Methods inherited from Renderers::Base

acts_as_renderer, #in_set?, #render, #renderer=, #where_is?

Constructor Details

#initialize(c = Complex(0.36, 0.1)) ⇒ Julia



74
75
76
77
78
# File 'lib/fractals.rb', line 74

def initialize(c=Complex(0.36, 0.1))
  super(c, {:p => 2}) do |args|
                        args[:z] = args[:z]**args[:p] + c
                      end
end