mt
Class MT_CrazySpiral

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by mt:MT_CrazySpiral

class 
UserTransform:MT_CrazySpiral

Mark Townsend, May 2008


Ultra Fractal Source

Toggle UF Source Code Display

 class MT_CrazySpiral(common.ulb:UserTransform) {
 ;
 ; Mark Townsend, May 2008
 ;
 public:
   func MT_CrazySpiral(Generic pparent)
     UserTransform.UserTransform(pparent)
   endfunc
   
   complex func Iterate(complex pz)
     m_Iterations = m_Iterations + 1
     w = pz - @center
     float r = cabs(w)
     float theta = atan2(w)
     if theta < 0
       theta = theta + 2 * #pi
     endif
     theta = @a * real(@fn1(r)) + theta + @amp * sin(@b  * theta)
     float x = r * cos(theta)
     float y = r * sin(theta)
     return x + flip(y) + @center
   endfunc
 
 default:
   title = "Crazy Spiral"
   param center
     caption = "Center"
     default = (0,0)
   endparam
    param a
     caption = "Tightness"
     default = 3.0
   endparam
   param b
     caption = "Wave frequency"
     default = 20.0
   endparam
   param amp
     caption = "Wave amplitude"
     default = 1.0
   endparam
   func fn1
     caption = "Function"
     default = ident()
   endfunc
 }
 


Constructor Summary
MT_CrazySpiral()
           
MT_CrazySpiral(Generic pparent)
           
 
Method Summary
 complex Iterate(complex pz)
          Transform a single point within a sequence
 
Methods inherited from class common:Transform
Init, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MT_CrazySpiral

public MT_CrazySpiral(Generic pparent)

MT_CrazySpiral

public MT_CrazySpiral()
Method Detail

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value