mt
Class MT_RadialWaves

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

class 
UserTransform:MT_RadialWaves

Mark Townsend, May 2008


Ultra Fractal Source

Toggle UF Source Code Display

 class MT_RadialWaves(common.ulb:UserTransform) {
 ;
 ; Mark Townsend, May 2008
 ;
 public:
   func MT_RadialWaves(Generic pparent)
     UserTransform.UserTransform(pparent)
   endfunc
   
   complex func Iterate(complex pz)
     m_Iterations = m_Iterations + 1
     float r = cabs(pz - @center)
     float theta = atan2(pz - @center)
     if theta < 0
       theta = theta + 2 * #pi
     endif
     int iter = 0
     while iter < @iterations
       float or = r
       r = r + @a * sin(@t * theta)
       theta = theta + @a2 * cos(@t2 * or)
       iter = iter + 1
     endwhile
     float x = r * cos(theta)
     float y = r * sin(theta)
     return x + flip(y) + @center
   endfunc
 
 default:
   title = "Radial Waves"
   param center
     caption = "Center"
     default = (0,0)
   endparam
   param iterations
     caption = "Iterations"
     default = 2
   endparam
   param t2
     caption = "Theta frequency"
     default = 20.0
   endparam
   param a2
     caption = "Theta amplitude"
     default = 0.1
   endparam
   param t
     caption = "Radius frequency"
     default = 20.0
   endparam
   param a
     caption = "Radius amplitude"
     default = 0.1
   endparam
 }
 


Constructor Summary
MT_RadialWaves()
           
MT_RadialWaves(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_RadialWaves

public MT_RadialWaves(Generic pparent)

MT_RadialWaves

public MT_RadialWaves()
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