mt
Class MT_BofNewtonI

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:ConvergentFormula
              extended by mt:MT_BofNewtonI

class 
ConvergentFormula:MT_BofNewtonI

Mark Townsend, May 2008


Ultra Fractal Source

Toggle UF Source Code Display

 class MT_BofNewtonI(common.ulb:ConvergentFormula) {
 ;
 ; Mark Townsend, May 2008
 ;
 public:
   complex func Init(complex pz)
     ConvergentFormula.Init(pz)
     fPixel = pz
     fH = 0.0001
     return @p_start
   endfunc
 
   complex func Iterate(complex pz)
     ConvergentFormula.Iterate(pz)
     complex zh = pz + fH
     complex fz = (pz - 1) * (pz + fPixel) * (pz^2 + 1)
     complex fzd = 1 / fH *((zh - 1) * (zh + fPixel) *(zh^2 + 1) - fz)
     return pz - fz / fzd
   endfunc
 
 private:
   complex fPixel
   complex fH
 
 default:
   title = "Bof Newton I"
   complex param @p_start
     caption = "Starting point"
     default = (0, 0)
   endparam
   complex param p_power
     visible = false
   endparam
   float param p_bailout
     caption = "Bailout"
     default = 1.0e-6
   endparam
 }
 


Constructor Summary
MT_BofNewtonI()
           
 
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:ConvergentFormula
GetLowerBailout, IsBailedOut
 
Methods inherited from class common:Formula
GetPrimaryExponent, GetUpperBailout
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MT_BofNewtonI

public MT_BofNewtonI()
Method Detail

Init

public complex Init(complex pz)
Description copied from class: ConvergentFormula
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 ConvergentFormula
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: ConvergentFormula
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 ConvergentFormula
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