reb
Class REB_TrapShapeCosMartin

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

class 
TrapShape:REB_TrapShapeCosMartin

Uses the CosMartin strange attractor as the trap shape. Can also be used as a texture.
CosMartin is the cosine variant of the Martin strange attractor.


Ultra Fractal Source

Toggle UF Source Code Display

 class REB_TrapShapeCosMartin(common.ulb:TrapShape) {
 ; Uses the CosMartin strange attractor as the trap shape. Can also be used as a texture. <br>
 ; CosMartin is the cosine variant of the Martin strange attractor. <br>
  public:
    import "common.ulb"
 
 ; Constructor
    func REB_TrapShapeCosMartin(Generic pparent)
      TrapShape.TrapShape(pparent)
    endfunc
    
   ; Call this for each iteration being trapped.      
    float func Iterate(complex pz)
     TrapShape.Iterate(pz)
     int sgn = 1
     if @sgn
       sgn = -1
     endif
      float x = real(pz)*@s
      float y = imag(pz)*@s
      float pxx = 0
      int att_iter = 0
 
      while att_iter < @max_att_iterations
        pxx = x
        x = y - cos(x)
        y = @h1 - pxx
        att_iter = att_iter + 1
      endwhile
      m_LastZ = (x + sgn*flip(y))
      float d = @distscale*|pz-(x + sgn*flip(y))|
      return d
    endfunc
    
  default:
    title = "CosMartin"
   int param v_trapshapecosmartin
     caption = "Version (Trap Shape CosMartin)"
     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_trapshapecosmartin < 101
   endparam
    
    float param h1
      caption = "CosMartin param"
      default = 6.28
    endparam
    float param distscale
      caption = "Distance scale"
      default = 0.01
    endparam
    float param s
      caption = "Attractor scale"
      default = 15
    endparam
    int param max_att_iterations
      caption = "Attractor iterations"
      default = 5
    endparam
    bool param sgn
      caption = "Conjugate transform"
      default = false
    endparam
  }
 


Constructor Summary
REB_TrapShapeCosMartin()
           
REB_TrapShapeCosMartin(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_TrapShapeCosMartin

public REB_TrapShapeCosMartin(Generic pparent)
Constructor


REB_TrapShapeCosMartin

public REB_TrapShapeCosMartin()
Method Detail

Iterate

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

Overrides:
Iterate in class TrapShape