class MT_YorkeTexture(common.ulb:TrapShape) {
;
; Mark Townsend, May 2008
;
public:
func MT_YorkeTexture(Generic pparent)
TrapShape.TrapShape(pparent)
A110 = -0.26813663648754
B110 = 0.98546084298505
A210 = 0.08818611671542
B210 = 0.99030722865609
A101 = -0.91067559396390
B101 = 0.50446045609351
A201 = -0.56502889980448
B201 = 0.33630697012268
A111 = 0.31172026382793
B111 = 0.94707472523078
A211 = 0.16299548727086
B211 = 0.29804921230971
A11m1 = -0.04003977835470
B11m1 = 0.23350105508507
A21m1 = -0.80398881978155
B21m1 = 0.15506467277737
twopi = 2 * #PI
endfunc
float func Iterate(complex pz)
int i = 0
float x = real(pz)
float y = imag(pz)
while i < @max_iterations
float trigx = A110 * sin(TWOPI * (x + B110)) + \
A101 * sin(TWOPI * (y + B101)) + \
A111 * sin(TWOPI * (x + y + B111)) + \
A11m1 * sin(TWOPI * (x - y + B11m1))
float trigy = A210 * sin(TWOPI * (x + B210)) + \
A201 * sin(TWOPI * (y + B201)) + \
A211 * sin(TWOPI * (x + y + B211)) + \
A21m1 * sin(TWOPI * (x - y + B21m1))
x = (x + @xshift + @a * trigx)
y = (y + @yshift + @a * trigy)
i = i + 1
endwhile
m_LastZ = x + flip(y)
return cabs(pz - m_LastZ)
endfunc
private:
float A110
float B110
float A210
float B210
float A101
float B101
float A201
float B201
float A111
float B111
float A211
float B211
float A11m1
float B11m1
float A21m1
float B21m1
float twopi
default:
title = "Yorke Texture"
float param a
caption = "Chaoticity"
default = 0.5
endparam
float param xshift
caption = "X Shift"
default = 0.486
endparam
float param yshift
caption = "Y Shift"
default = 0.905
endparam
param max_iterations
caption = "Iterations"
default = 3
min = 1
endparam
}