Sample Data Generation

Home • Gallery • Tutorials • Download • Purchase • Site Map
 

Sample Data Generation Overview

For those just beginning to learn how to use the Fractal Science Kit fractal generator, this section is probably too much information J. However, after you become familiar with the different types of programs, it is useful to know how they fit together. This section provides a very high level view of the Fractal Science Kit framework with respect to Mandelbrot and Orbital fractals.

Mandelbrot Fractals

The following pseudo-code outlines the sample data generation for Mandelbrot fractals:

For each pixel in the selected area of complex plane {
  pixel = Transformation(pixel)
  '
  ' Initialize variables z and c used by FractalEquation
  '
  If (IsJulia) {
    z = pixel
    c = julia constant
  } else {
    z = initial z
    c = pixel
  }
  execute FractalEquation initialize: section and update z
  execute AlternateMapping1 initialize: section
  execute AlternateMapping2 initialize: section
 
  orbitPoints[0] = z
  dwell = 0
  '
  ' Orbit iteration
  '
  While (dwell < MaxDwell) {
    execute FractalEquation iterate: section and update z
   
    dwell += 1
    orbitPoints[dwell] = z
   
    compute magnitude of z
   
    if (dwell >= MinDwell) {
      exit orbit iteration if point diverged/converged
    }
    execute AlternateMapping1 iterate: section
    execute AlternateMapping2 iterate: section
    '
    ' Apply orbit traps
    '
    p = Transformation1(p)
   
    if (SymmetryTransformation <> None) {
      s[] = SymmetryTransformation(p)
    } else {
      s[] = p
    }
    for each point p in s[] {
      p = Transformation2(p)
      pass p to each OrbitTrap and update trappedPoints[]
    }
  }
  execute AlternateMapping1 finalize: section
  execute AlternateMapping2 finalize: section
  Process trappedPoints[]
 
  if point did not diverge/converge {
    dwell = MaxDwell + 1
  }
  update sample[pixel]
}

Orbital Fractals

The following pseudo-code outlines the sample data generation for Orbital fractals:

z = initial z

execute OrbitalEquation initialize: section

count = 0
'
' Orbit iteration
'
while (count < MaxCount) {
  execute OrbitalEquation iterate: section and update z
 
  exit orbit iteration if point diverged
 
  add z to orbitPoints[] queue
 
  If (count > MinCount) {
    p = Transformation1(p)
   
    if (SymmetryTransformation <> None) {
      s[] = SymmetryTransformation(p)
    } else {
      s[] = p
    }
    for each point p in s[] {
      p = Transformation2(p)
      update sample[p] statistics
    }
  }
  count += 1
}
 

 

Copyright © 2004-2019 Ross Hilbert
All rights reserved