reb
Class REB_TrapShapeFibonacci

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by reb:REB_TrapShapeFibonacci

class 
TrapShape:REB_TrapShapeFibonacci

This shape based upon Fibonacci numbers

The trap shape is determined by distances from Fibonacci numbers. One of the interesting characteristics of the shape are multiple 3D like arrows that follow the flow shape of the trap.


Ultra Fractal Source

Toggle UF Source Code Display

 class REB_TrapShapeFibonacci(common.ulb:TrapShape) {
  ; This shape based upon Fibonacci numbers <br>
  ; <p>
  ; The trap shape is determined by distances from Fibonacci numbers. One of the
  ; interesting characteristics of the shape are multiple 3D like arrows that
  ; follow the flow shape of the trap.
  public:
    import "common.ulb"
 
 ; Constructor
    func REB_TrapShapeFibonacci(Generic pparent)
      TrapShape.TrapShape(pparent)
    endfunc
    
   ; Call this for each iteration being trapped.
    float func Iterate(complex pz)
     TrapShape.Iterate(pz)
     float f1 = 0
     float f2 = 1
     float d = 0
     float d1 = 0
     float d2 = 0
     d1 =real(pz)-f2
     while d1 > 0
       float ftemp = f2
       f2 = f1 + f2
       f1 = ftemp
       d1 = real(pz)-f2
     endwhile
     d = real(pz)-f1  ; which fibonacci number is closest
     if d < abs(d1)
       d1 = d
     endif
     f1 = 0
     f2 = 1
     d2 = imag(pz)-f2
     while d2 > 0
       ftemp = f2
       f2 = f1 + f2
       f1 = ftemp
       d2 = imag(pz)-f2
     endwhile
     d = real(pz)-f1  ; which fibonacci number is closest
     if d < abs(d2)
       d2 = d
     endif
     d = 5*(abs(d1) + abs(d2))
     m_LastZ = pz - (d1 + flip(d2))
      return d
    endfunc
    
  default:
    title = "Fibonacci"
   int param v_trapshapefibonacci
     caption = "Version (Trap Shape Fibonacci)"
     default = 101
     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_trapshapefibonacci < 101
   endparam
  }
 


Constructor Summary
REB_TrapShapeFibonacci()
           
REB_TrapShapeFibonacci(Generic pparent)
          Constructor
 
Method Summary
 float Iterate(complex pz)
          Call this for each iteration being trapped.
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, Init, IterateSilent, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

REB_TrapShapeFibonacci

public REB_TrapShapeFibonacci(Generic pparent)
Constructor


REB_TrapShapeFibonacci

public REB_TrapShapeFibonacci()
Method Detail

Iterate

public float Iterate(complex pz)
Call this for each iteration being trapped.

Overrides:
Iterate in class TrapShape