reb
Class REB_3RDIMMagnet1

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:ConvergentDivergentFormula
              extended by reb:REB_3RDIMMagnet1

class 
ConvergentDivergentFormula:REB_3RDIMMagnet1



Ultra Fractal Source

Toggle UF Source Code Display

 class REB_3RDIMMagnet1(common.ulb:ConvergentDivergentFormula) {
 ;
 public:
   ; constructor
   func REB_3RDIMMagnet1(Generic pparent)
      ConvergentDivergentFormula.ConvergentDivergentFormula(pparent)
    endfunc
 
   ; initialize the formula
   complex func Init(complex pz)
     ConvergentDivergentFormula.Init(pz)
     complex z2 = pz
     pz = 0
     m_c = @p2+real(z2)+flip(imag(z2)*@p1)
     return pz
   endfunc
 
   ; call for each iterated point
   complex func Iterate(complex pz)
     ConvergentDivergentFormula.Iterate(pz)
     return sqr( (pz^2 + m_c - 1) / (2*pz + m_c - 2) )
   endfunc
 
   ; Override the default function for bailout
   bool func IsBailedOut(complex pz)
     return |pz| >= @p_upperbailout || |pz - 1| <= @p_lowerbailout
   endfunc
 
 private:
   complex m_c
 
 default:
   title = "3RDIM Magnet 1"
   int param v_3RDIMMagnet1
     caption = "Version (3RDIM Magnet 1)"
     default = 100
     hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
     visible = @v_3RDIMMagnet1< 100
   endparam
   heading
     text = "Most Mandelbrot-type formulas initialize in the z plane and iterate \
            in the c plane. Gordon Lamb proposed a geometry which involves iteration \
            in the zc plane (type SJ) or in the cz plane (type 3RDIM). A 'Plane \
            hybridization' value of zero gives pure zc or cz iteration, while a \
            'Plane hybridization' value of one gives the classical c plane iteration. \
            Intermediate values can produce very interesting results."
   endheading
   param start
     caption = "Perturbation"
     default = (0, 0)
     hint = "Starting value for each point. You can use this to \
             'perturb' the fractal. Use (0, 0) for the classic set."
   endparam
   float param p1
      caption = "Plane hybridization"
      default = 0.5
      min = 0
      max = 1
   endparam
   param p2
     caption = "Iteration Plane position"
     default = (0.0,0.0)
   endparam
   param p_upperbailout ; Overrides p_upperbailout from ConvergentDivergentFormula
     caption = "Bailout value"
     default = 100.0
     min = 1
 ;    exponential = true
     hint = "This parameter defines how soon an orbit bails out while \
             iterating. Larger values give smoother outlines; smaller values \
             generally produce more interesting shapes around the set."
   endparam
   param p_lowerbailout ; Overrides p_lowerbailout from ConvergentDivergentFormula
     caption = "Convergent bailout value"
     default = 0.00001
     min = 0
 ;    exponential = true
     hint = "This parameter defines how soon a convergent orbit bails out while \
             iterating. Smaller values give more precise results but usually \
             require more iterations."
   endparam
   complex param p_power ; Hide p_power from Formula
     visible = false
   endparam
 }
 


Constructor Summary
REB_3RDIMMagnet1()
           
REB_3RDIMMagnet1(Generic pparent)
          constructor
 
Method Summary
 complex Init(complex pz)
          initialize the formula
 boolean IsBailedOut(complex pz)
          Override the default function for bailout
 complex Iterate(complex pz)
          call for each iterated point
 
Methods inherited from class common:ConvergentDivergentFormula
GetLowerBailout, GetUpperBailout
 
Methods inherited from class common:Formula
GetPrimaryExponent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

REB_3RDIMMagnet1

public REB_3RDIMMagnet1(Generic pparent)
constructor


REB_3RDIMMagnet1

public REB_3RDIMMagnet1()
Method Detail

Init

public complex Init(complex pz)
initialize the formula

Overrides:
Init in class ConvergentDivergentFormula
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)
call for each iterated point

Overrides:
Iterate in class ConvergentDivergentFormula
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

IsBailedOut

public boolean IsBailedOut(complex pz)
Override the default function for bailout

Overrides:
IsBailedOut in class ConvergentDivergentFormula
Parameters:
pz - last sequence value to test; this should be the value returned from the previous Iterate() call. Note that it is acceptable to ignore pz and use m_BailedOut, but any code calling IsBailedOut() should pass in the correct pz for Formula classes which do not use m_BailedOut.
Returns:
true if the sequence has bailed out (i.e. should be terminated)