mt
Class MT_Druid

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:DivergentFormula
              extended by mt:MT_Druid

class 
DivergentFormula:MT_Druid

Mark Townsend, April 2008


Ultra Fractal Source

Toggle UF Source Code Display

 class MT_Druid(common.ulb:DivergentFormula) {
 ;
 ; Mark Townsend, April 2008
 ;
 public:
   complex func Init(complex pz)
     fPixel = pz
     fIter = 0
     return @start
   endfunc
 
   complex func Iterate(complex pz)
     if fIter % 2 == 0
       complex newz = pz^@p_power + fPixel
     else
       newz = pz^@p_power
       newz = newz - real(newz) + abs(real(newz)) + fPixel
     endif
     fIter = fIter + 1
     return newz
   endfunc
 
 private:
   complex fPixel
   int fIter
 
 default:
   title = "Druid"
   param start
     caption = "Starting point"
     default = (0,0)
   endparam
   param p_power
     caption = "Power"
     default = (2,0)
   endparam
   float param p_bailout
     caption = "Bailout value"
     default = 128.0
     min = 1.0
     exponential = true
   endparam
 }
 


Constructor Summary
MT_Druid()
           
 
Method Summary
 complex Init(complex pz)
          Set up for a sequence of values
 complex Iterate(complex pz)
          Produce the next value in the sequence
 
Methods inherited from class common:DivergentFormula
GetUpperBailout, IsBailedOut
 
Methods inherited from class common:Formula
GetLowerBailout, GetPrimaryExponent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MT_Druid

public MT_Druid()
Method Detail

Init

public complex Init(complex pz)
Description copied from class: DivergentFormula
Set up for a sequence of values

This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).

Overrides:
Init in class DivergentFormula
Parameters:
pz - seed value for the sequence; for a normal fractal formula, this will be #pixel
Returns:
first value in the sequence; this corresponds to #z in a fractal formula

Iterate

public complex Iterate(complex pz)
Description copied from class: Formula
Produce the next value in the sequence

As long as the sequence has not bailed out, this function will be continually called to produce sequence values.

Overrides:
Iterate in class Formula
Parameters:
pz - previous value in the sequence; corresponds to #z in a fractal formula. Note that you should always use this value for computing the next iteration, rather than a saved value, as the calling code may modify the returned value before passing it back to the next Iterate() call.
Returns:
the next value in the sequence