In Files

Parent

Methods

Fractals::Newton

The Newton fractal.

Public Class Methods

new(c=Complex(0.0, 0.0)) click to toggle source

(Not documented)

# 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

Private Instance Methods

derivative(dx) click to toggle source

(Not documented)

# File lib/fractals.rb, line 101
    def derivative(dx)
      lambda { |x| (yield(x + dx) - yield(x)) / dx }
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.