dmj5
Class DMJ_TrapShapeLinearWave

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by dmj5:DMJ_TrapShapeLinearWave

class 
TrapShape:DMJ_TrapShapeLinearWave



Ultra Fractal Source

Toggle UF Source Code Display

 class DMJ_TrapShapeLinearWave(common.ulb:TrapShape) {
 public:
   import "common.ulb"
 
   func DMJ_TrapShapeLinearWave(Generic pparent)
     TrapShape.TrapShape(pparent)
   endfunc
   
   float func Iterate(complex pz)
     TrapShape.Iterate(pz)
 
     float d = 0
     if (@p_mirroring == 0)
       if (@p_merging == 0)
         d = abs(imag(pz) + \
             sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 + \
             sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2)
       elseif (@p_merging == 1)
         d = abs(imag(pz) + \
             sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 * \
             sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2)
       endif
 
     elseif (@p_mirroring == 1)
       if (@p_merging == 0)
         d = abs(imag(pz)) + \
             sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 + \
             sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2
       elseif (@p_merging == 1)
         d = abs(imag(pz)) + \
             sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 * \
             sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2
       endif
       d = abs(d)
 
     elseif (@p_mirroring == 2)
       float d2 = 0
       if (@p_merging == 0)
         d2 = sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 + \
            sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2
       elseif (@p_merging == 1)
         d2 = sin((real(pz)+@p_phase1*#pi/180)*@p_frequency1)*@p_amplitude1 * \
            sin((real(pz)+@p_phase2*#pi/180)*@p_frequency2)*@p_amplitude2
       endif
       d  = abs(abs(imag(pz)) - d2)  ; distance to each wave
       d2 = abs(abs(imag(pz)) + d2)
       if (d2 < d)
         d = d2
       endif
 
     endif
     return d
   endfunc
   
 default:
   title = "Linear Wave"
 
   int param v_dmj_trapshapelinearwave
     caption = "Version (DMJ_TrapShapeLinearWave)"
     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_dmj_trapshapelinearwave < 100
   endparam
   
   int param p_mirroring
     caption = "Mirroring"
     default = 0
     enum = "none" "half" "full"
     hint = "Sets how the trap shape will be reflected along a line."
   endparam
   int param p_merging
     caption = "Wave Merging"
     default = 0
     enum = "add" "multiply"
     hint = "Sets how the two frequency generators should be combined into a final wave."
   endparam
   float param p_amplitude1
     caption = "Amplitude 1"
     default = 1.0
     hint = "Sets one of the wave amplitudes. Higher amplitudes will result in higher peaks."
   endparam
   float param p_frequency1
     caption = "Frequency 1"
     default = 1.0
     visible = @p_amplitude1 != 0.0
     hint = "Sets one of the wave frequencies. Higher frequencies will result in more tightly-spaced peaks in the wave."
   endparam
   float param p_phase1
     caption = "Phase 1"
     default = 0.0
     visible = @p_amplitude1 != 0.0
     hint = "Sets the phase of one of the waves, in degrees."
   endparam
   float param p_amplitude2
     caption = "Amplitude 2"
     default = 0.0
     hint = "Sets one of the wave amplitudes. Higher amplitudes will result in higher peaks."
   endparam
   float param p_frequency2
     caption = "Frequency 2"
     default = 3.0
     visible = @p_amplitude2 != 0.0
     hint = "Sets one of the wave frequencies. Higher frequencies will result in more tightly-spaced peaks in the wave."
   endparam
   float param p_phase2
     caption = "Phase 2"
     default = 0.0
     visible = @p_amplitude2 != 0.0
     hint = "Sets the phase of one of the waves, in degrees."
   endparam
 }
 


Constructor Summary
DMJ_TrapShapeLinearWave()
           
DMJ_TrapShapeLinearWave(Generic pparent)
           
 
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

DMJ_TrapShapeLinearWave

public DMJ_TrapShapeLinearWave(Generic pparent)

DMJ_TrapShapeLinearWave

public DMJ_TrapShapeLinearWave()
Method Detail

Iterate

public float Iterate(complex pz)
Description copied from class: TrapShape
call this for each iteration being trapped

Overrides:
Iterate in class TrapShape