reb
Class REB_TrapShapeSierpinski
Object
common:Generic
common:TrapShape
reb:REB_TrapShapeSierpinski
class
- TrapShape:REB_TrapShapeSierpinski
This shape uses the Sierpinski strange attractor.
Ultra Fractal Source
Toggle UF Source Code Display
class REB_TrapShapeSierpinski(common.ulb:TrapShape) {
; This shape uses the Sierpinski strange attractor.
public:
import "common.ulb"
; Constructor
func REB_TrapShapeSierpinski(Generic pparent)
TrapShape.TrapShape(pparent)
endfunc
; Call this for each iteration being trapped.
float func Iterate(complex pz)
TrapShape.Iterate(pz)
complex pp = pz*@s
int att_iter = 0
while att_iter < @max_att_iterations
if (imag(pp) > @h3)
pp = @h1*real(pp) + flip(@h1*imag(pp) -@h2)
elseif (real(pp) > @h4)
pp = @h1*real(pp) -@h2 + flip(@h1*imag(pp))
else
pp = @h1*real(pp) + flip(@h1*imag(pp))
endif
att_iter = att_iter + 1
endwhile
if !@sgn
m_LastZ = pp
else
m_LastZ = conj(pp)
endif
float d = @distscale*|pz-pp|
return d
endfunc
default:
title = "Sierpinski"
int param v_trapshapesierpinski
caption = "Version (Trap Shape Sierpinski)"
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_trapshapesierpinski < 101
endparam
float param h1
caption = "Sierpinski 1"
default = 2
endparam
float param h2
caption = "Sierpinski 2"
default = 1
endparam
float param h3
caption = "Sierpinski 3"
default = 0.5
endparam
float param h4
caption = "Sierpinski 4"
default = 0.5
endparam
float param distscale
caption = "Distance scale"
default = 1
endparam
float param s
caption = "Attractor scale"
default = 0.1
endparam
int param max_att_iterations
caption = "Attractor iterations"
default = 10
endparam
bool param sgn
caption = "Conjugate transform"
default = false
endparam
}
Method Summary |
float |
Iterate(complex pz)
Call this for each iteration being trapped. |
Methods inherited from class Object |
|
REB_TrapShapeSierpinski
public REB_TrapShapeSierpinski(Generic pparent)
- Constructor
REB_TrapShapeSierpinski
public REB_TrapShapeSierpinski()
Iterate
public float Iterate(complex pz)
- Call this for each iteration being trapped.
- Overrides:
Iterate
in class TrapShape