reb
Class REB_3RDIMIkenagaJulia

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:DivergentFormula
              extended by reb:REB_3RDIMIkenagaJulia

class 
DivergentFormula:REB_3RDIMIkenagaJulia



Ultra Fractal Source

Toggle UF Source Code Display

 class REB_3RDIMIkenagaJulia(common.ulb:DivergentFormula) {
 public:
   import "common.ulb"
 
   ; constructor
   func REB_3RDIMIkenagaJulia(Generic pparent)
      DivergentFormula.DivergentFormula(pparent)
    endfunc
 
   ; initialize the formula
   complex func Init(complex pz)
     DivergentFormula.Init(pz)
     complex z2 = pz
     pz=@p1*real(z2)+flip(imag(z2))
     m_c=@p2+real(@p3)+flip(imag(@p3)*@p1)
     return pz
   endfunc
 
   ; call for each iterated point
   complex func Iterate(complex pz)
     DivergentFormula.Iterate(pz)
     return pz^3 + (m_c-1)*pz - m_c
   endfunc
 
   ; Override the default function for bailout
   bool func IsBailedOut(complex pz)
     bool bail = false
     if @test == 0
       bail = (|pz| > @p_bailout)
     elseif @test == 1
       bail = (sqr(real(pz)) > @p_bailout)
     elseif @test == 2
       bail = (sqr(imag(pz)) > @p_bailout)
     elseif @test == 3
       bail = (sqr(real(pz)) > @p_bailout || sqr(imag(pz)) > @p_bailout)  
     elseif @test == 4
       bail = (sqr(real(pz)) > @p_bailout && sqr(imag(pz)) > @p_bailout)  
     elseif @test == 5
       bail = (sqr(abs(real(pz)) + abs(imag(pz))) > @p_bailout)
     elseif @test == 6
       bail = (sqr(real(pz) + imag(pz)) > @p_bailout)
     endif
     return bail
   endfunc
   
 protected:
   complex m_c  
 
 default:
   title = "3RDIM Ikenaga Julia"
   int param v_3RDIMIkenagaJulia
     caption = "Version (3RDIM Ikenaga Julia)"
     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_3RDIMIkenagaJulia < 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
   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 test
     caption = "Bailout Test"
     default = 0
     enum = "mod" "real" "imag" "or" "and" "manh" "manr"
     hint = "mod is the standard bailout. The remaining bailout methods are \
             from Fractint."
   endparam
   float param p_bailout ; Overrides p_bailout from DivergentFormula
     caption = "Bailout value"
     default = 10000.0
     min = 1.0
     hint = "Use a value of 4 if the bailout test is other than mod."
   endparam
   param p3
     caption = "Julia seed"
     default = (0.05,0.45)
   endparam
   complex param p_power ; Overrides p_power from Formula
     caption = "Power"
     default = (2,0)
     visible = false
   endparam
 }
 


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

Constructor Detail

REB_3RDIMIkenagaJulia

public REB_3RDIMIkenagaJulia(Generic pparent)
constructor


REB_3RDIMIkenagaJulia

public REB_3RDIMIkenagaJulia()
Method Detail

Init

public complex Init(complex pz)
initialize the formula

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)
call for each iterated point

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

IsBailedOut

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

Overrides:
IsBailedOut in class DivergentFormula
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)