Class Fractals::Newton
In: lib/fractals.rb
Parent: Fractals::Fractal

The Newton fractal.

Methods

new  

Public Class methods

[Source]

# File lib/fractals.rb, line 92
    def initialize(c=Complex(0.0, 0.0))
      super(c, {:a => 1, :pz => lambda { |z| z**3 - 1 }}) do |args|
                                                            dx_pz = derivative(0.0001) { |x| args[:pz].call(x) }
                                                            args[:z] = args[:z] - args[:a] *
                                                              (args[:pz].call(args[:z]) / (dx_pz.call(args[:z])))
                                                          end
    end

[Validate]