Class: Fractals::BurningShip

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

Overview

Michael Michelitsch’s Burning Ship 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.3, -0.5)) ⇒ BurningShip

Returns a new instance of BurningShip.



64
65
66
67
68
69
# File 'lib/fractals.rb', line 64

def initialize(c=Complex(-0.3, -0.5))
  super(c, {:p => 2}) do |args|
                        args[:z] = (args[:z].real.abs + sqrt(-1) *
                          args[:z].image.abs)**args[:p] + args[:c]
                      end
end