mt
Class MT_BarnsleyTransform

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by mt:MT_BarnsleyTransform

class 
UserTransform:MT_BarnsleyTransform

Mark Townsend, May 2008


Ultra Fractal Source

Toggle UF Source Code Display

 class MT_BarnsleyTransform(common.ulb:UserTransform) {
 ;
 ; Mark Townsend, May 2008
 ;
 public:
   func MT_BarnsleyTransform(Generic pparent)
     UserTransform.UserTransform(pparent)
   endfunc
   
   complex func Iterate(complex pz)
     m_Iterations = m_Iterations + 1
     int iter = 0
     complex z = pz
     while iter < @max_iter
       if real(z) * imag(@start) + real(@start) * imag(z) >= 0
         z = (z - 1) * @start
       else
         z = (z + 1) * @start
       endif
       iter = iter + 1
     endwhile
     return z
   endfunc
 
 default:
   title = "Barnsley"
   param start
     caption = "Julia Seed"
     hint = "This is the Julia seed for the Barnsley fractal."
     default = (0.6, 1.1)
   endparam
   param max_iter
     caption = "Iterations"
     hint = "This is the number of iterations to \
             calculate the Barnsley fractal."
     default = 10
   endparam
  }
 


Constructor Summary
MT_BarnsleyTransform()
           
MT_BarnsleyTransform(Generic pparent)
           
 
Method Summary
 complex Iterate(complex pz)
          Transform a single point within a sequence
 
Methods inherited from class common:Transform
Init, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MT_BarnsleyTransform

public MT_BarnsleyTransform(Generic pparent)

MT_BarnsleyTransform

public MT_BarnsleyTransform()
Method Detail

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value