dmj5
Class DMJ_LogSpiral
Object
common:Generic
common:Transform
common:UserTransform
dmj5:DMJ_LogSpiral
class
- UserTransform:DMJ_LogSpiral
Distort to follow a logarithmic spiral.
(Ported from dmj3.uxf:dmj3-LogSpiral)
Ultra Fractal Source
Toggle UF Source Code Display
class DMJ_LogSpiral(common.ulb:UserTransform) {
; Distort to follow a logarithmic spiral.
; (Ported from dmj3.uxf:dmj3-LogSpiral)
public:
import "common.ulb"
func DMJ_LogSpiral(Generic pparent)
UserTransform.UserTransform(pparent)
endfunc
complex func Iterate(complex pz)
m_Iterations = m_Iterations + 1
float a = atan2(pz - @p_spiralcenter) * 0.5 / #pi
float d = cabs(pz - @p_spiralcenter)
float d2 = log(d)*@p_spiraltightness + a
float d2f = d2 - floor(d2)
float d2i = d2 - d2f
pz = (d2i-a)*@p_spiralascale + flip(d2f)*@p_spiraldscale + @p_spiraloffset
return pz
endfunc
protected:
default:
title = "Log Spiral"
int param v_dmj_logspiral
caption = "Version (DMJ_LogSpiral)"
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_logspiral < 100
endparam
complex param p_spiralcenter
caption = "Spiral Center"
default = (0,0)
endparam
float param p_spiralascale
caption = "Rotational scale"
default = 1.0
endparam
float param p_spiraldscale
caption = "Distance scale"
default = 1.0
endparam
float param p_spiraltightness
caption = "Tightness"
default = 1.0
endparam
complex param p_spiraloffset
caption = "Strip Offset"
default = (0,0)
endparam
}
Methods inherited from class Object |
|
DMJ_LogSpiral
public DMJ_LogSpiral(Generic pparent)
DMJ_LogSpiral
public DMJ_LogSpiral()
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