class Fractals::Julia

Attributes

imaginary[RW]
real[RW]

Since the Julia set only has a slightly modified calculation

Public Instance Methods

calculate(a, b, c_arr) click to toggle source
# File lib/fractal.rb, line 73
def calculate a, b, c_arr
  # c_arr is irrelevant as c is now constant,
  # however the #draw() still supplies it and
  # I don't want to rewrite draw when it already exists.
  left = a * a - b * b
  right = 2 * a * b
  a = left  + @real      # z^2 + c
  b = right + @imaginary
  return [a, b]
end