It looks like you're using an Ad Blocker.

Please white-list or disable AboveTopSecret.com in your ad-blocking tool.

Thank you.

 

Some features of ATS will be disabled while you continue to use an ad-blocker.

 

Ultra Fractal 3 anyone

page: 1
0

log in

join
share:

posted on Oct, 27 2002 @ 10:39 AM
link   
Was wondering if anyone else on the board has an interest in fractal images.

I have just obtained i will say a copy off Ultra Fractal 3 and its great complicated to use but well ain`t everything at the start really.

If anyone else into this please post would be interested in some mathematical formulas for these images off chao`s.

thanks Natt



posted on Oct, 27 2002 @ 06:18 PM
link   
yeah, sure, post away. i can use 'em



posted on Oct, 28 2002 @ 02:47 AM
link   
There are a few bugs in the formula but, as you use them you could correct them and post your findings.

Any help would be great as they do get a bit complex,and when you look for errors sometimes you can`t quite find them.

Thanx for Help Natt

ps would you post one off yours to see what others have come up with.

init:

; complex _fd_dist
float _dist = 0

; float _ft_dist = 0
float _tdist = 0

bool _do_trap = true
float _trap = 0.01

complex zStart = 0

if (@initialisation == 0) ; init:
zStart = @i_randomness * #random
endif;

loop:

if (@initialisation == 1) ; loop:
zStart = #z + @i_randomness * #random
endif;

;
; Start with the lattices
;
if (@lattice == 1)
zStart = round(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 2)
zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 3)
zStart = floor(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 4)
zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 5)
zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2

elseif (@lattice == 6)
zStart = round(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 7)
zStart = trunc(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 8)
zStart = floor(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 9)
zStart = ceil(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 10)
zStart = abs(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))

elseif (@lattice == 11)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 12)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 13)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 14)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 15)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*zStart^2)^2) \
- @lattFac2*zStart^2

elseif (@lattice == 16)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 17)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 18)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 19)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 20)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2

endif

complex _fd_dist = @fkt_d(zStart)-@fkt_d(#pixel)
_dist = cabs(_fd_dist)

complex _ft_dist = @fkt_1(zStart)-@fkt_2(#pixel)
_tdist = cabs(_ft_dist)

if _do_trap && @_trap_min < _tdist && _tdist < @_trap_max
_do_trap = false
_trap =_dist
endif

final:

#index = _trap + @f_randomness * real(#random)

default:
title = "Some traps with functions"

param _trap_min
caption = "lower border for trap"
default = 1.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param _trap_max
caption = "upper border for trap"
default = 2.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param lattice
caption = "Lattice Type"
enum = "None" \
"round" "trunc" "floor" "ceil" "abs" \
"r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \
"round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \
"r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2"
default = 0
endparam

param lattFac1
caption = "Lattice Factor 1"
default = (0.1,0.0)
endparam

param lattFac2
caption = "Lattice Factor 2"
default = (0.1,0.0)
endparam

param with_zStart
caption = "zStart everywhere Y/N"
default = false
hint = "Works with the lattices"
endparam

param initialisation
caption = "Initialisation"
enum = "init:" "loop:"
default = 1
endparam

param i_randomness
caption = "i: Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

param f_randomness
caption = "f: Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

func fkt_d
caption = "Distance Function"
default = exp()
endfunc

func fkt_1
caption = "Trap Function 1"
default = ident()
endfunc

func fkt_2
caption = "Trap Function 2"
default = ident()
endfunc

] ; some_other_traps

weierstrass_p_func [

;

init:
float _dist = 0
float _rdist = 0
float _idist = 0

float _tdist = 0
float _cdist = 0
float _qdist = 0

float _rd = 0
float _id = 0

float _min_dist = 1e20
float _max_dist = -1

float _min_rdist = 1e20
float _max_rdist = -1

float _min_idist = 1e20
float _max_idist = -1

float _min_tdist = 1e20
float _max_tdist = -1

float _min_cdist = 1e20
float _max_cdist = -1

float _min_qdist = 1e20
float _max_qdist = -1

float temp = -1
; complex temp = (-1,0)

;
; Traps
;
bool _do_trap = true
float _trap = 0.01

bool _do_rtrap = true
float _rtrap = 0.01

bool _do_itrap = true
float _itrap = 0.01

bool _do_ttrap = true
float _ttrap = 0.01

bool _do_ctrap = true
float _ctrap = 0.01

;
; Sums
;
float _sum = 0
float _rsum = 0
float _isum = 0
float _tsum = 0
float _csum = 0
float _qsum = 0

complex _zz = #z ; init _zz
int iter = 0
complex zStart = 0

loop:

zStart = #z ; init zStart

;
; Start with the lattices
;
if (@lattice == 1)
zStart = round(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 2)
zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 3)
zStart = floor(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 4)
zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 5)
zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2

elseif (@lattice == 6)
zStart = round(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 7)
zStart = trunc(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 8)
zStart = floor(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 9)
zStart = ceil(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 10)
zStart = abs(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))

elseif (@lattice == 11)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 12)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 13)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 14)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 15)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*zStart^2)^2) \
- @lattFac2*zStart^2

elseif (@lattice == 16)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 17)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 18)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 19)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 20)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2

endif

_zz = zStart

iter = iter+1

;
; transformation
;

int lat_real = 0
int lat_imag = 0

complex lat_comp_pp = 0
complex lat_comp_pn = 0
complex lat_comp_np = 0
complex lat_comp_nn = 0

complex W_Fkt_z = 0

if (_zz == 0)
W_Fkt_z = 0
else
if (@Weierstrass == 0) ; P-Function
W_Fkt_z = 1/_zz^2
elseif (@Weierstrass == 1) ; Zeta-Function
W_Fkt_z = 1/_zz
elseif (@Weierstrass == 2) ; Sigma-Function
W_Fkt_z = _zz
endif
endif

;
; Calculate the P-Function
;
while (lat_real _max_rdist
_max_idist = _idist
endif

if @_mode == 8 && _tdist > _max_tdist
_max_tdist = _tdist
endif

if @_mode == 9 && _cdist > _max_cdist
_max_cdist = _cdist
endif

if @_mode == 30 && _qdist > _max_qdist
_max_qdist = _qdist
endif


;
; Calculate the traps
;

if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max
_do_trap = false
_trap =_dist
endif

if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max
_do_rtrap = false
_rtrap =_rdist
endif

if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max
_do_itrap = false
_itrap =_idist
endif

if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max
_do_ttrap = false
_ttrap =_tdist
endif

if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max
_do_ctrap = false
_ctrap =_cdist
endif


;
; Calculate the sums
;
if @_mode == 24
_sum = _sum + _dist
endif
if @_mode == 25
_rsum = _rsum + _rdist
endif
if @_mode == 26
_isum = _isum + _idist
endif
if @_mode == 27
_tsum = _tsum + _tdist
endif
if @_mode == 28
_csum = _csum + _cdist
endif
if @_mode == 31
_qsum = _qsum + _qdist
endif

final:

if @_mode == 0
temp = _min_dist ; "Min Dist"
elseif @_mode == 1
temp = _min_rdist ; "Min Real"
elseif @_mode == 2
temp = _min_idist ; "Min Imag"
elseif @_mode == 3
temp = _min_tdist ; "Min Triang"
elseif @_mode == 4
temp = _min_cdist ; "Min Cubus"

elseif @_mode == 5
temp = _max_dist ; "Max Dist"
elseif @_mode == 6
temp = _max_rdist ; "Max Real"
elseif @_mode == 7
temp = _max_idist ; "Max Imag"
elseif @_mode == 8
temp = _max_tdist ; "Max Triang"
elseif @_mode == 9
temp = _max_cdist ; "Max Cubus"

elseif @_mode == 10
temp = cabs(_zz - #pixel) ; "Act Dist"
elseif @_mode == 11
temp = abs(real(_zz-#pixel)) ; "Act Real"
elseif @_mode == 12
temp = abs(imag(_zz-#pixel)) ; "Act Imag"

elseif @_mode == 13
temp = _dist ; "Last Dist"
elseif @_mode == 14
temp = _rdist ; "Last Real"
elseif @_mode == 15
temp = _idist ; "Last Imag"
elseif @_mode == 16
temp = _tdist ; "Last Triang"
elseif @_mode == 17
temp = _cdist ; "Last Cubus"

elseif @_mode == 18
temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference"

elseif @_mode == 19
temp = _trap ; "Trap Dist"

elseif @_mode == 20
temp = _rtrap ; "Trap Real"

elseif @_mode == 21
temp = _itrap ; "Trap Imag"

elseif @_mode == 22
temp = _ttrap ; "Trap Triang"

elseif @_mode == 23
temp = _ctrap ; "Trap Cubus"


elseif @_mode == 24
temp = _sum ; "Sum Dist"

elseif @_mode == 25
temp = _rsum ; "Sum Real"

elseif @_mode == 26
temp = _isum ; "Sum Imag"

elseif @_mode == 27
temp = _tsum ; "Sum Triang"

elseif @_mode == 28
temp = _csum ; "Sum Cubus"

elseif @_mode == 29
temp = _min_qdist ; "Min MinQuot"

elseif @_mode == 30
temp = _max_qdist ; "Max MinQuot"

elseif @_mode == 32
temp = _qsum ; "Sum MinQuot"

elseif @_mode == 32
temp = _qdist ; "Last MinQuot"

endif

#index = real(@fkt(temp)) + @randomness * real(#random)

default:
title = "Three Weierstrass Functions Colouring"

param _mode
caption = "Dist. Mode"
enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \
"Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \
"Act Dist" "Act Real" "Act Imag" \
"Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \
"Difference" \
"Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \
"Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \
"Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot"
endparam

param Weierstrass
caption = "Weierstrass Function"
enum = "P-Function" "Zeta-Function" "Sigma-Function"
endparam

param exponent
caption= "Exponent for P"
default=1.0
endparam

param vector1
caption= "Lattice Vector 1"
default=(1,0)
endparam

param vector2
caption= "Lattice Vector 2"
default=(0,1)
endparam

param pure
caption= "Pure Weierstrass"
default=TRUE
endparam

func fkt
caption = "Additional Function"
default = ident()
endfunc

param _trap_min
caption = "lower border for trap"
default = 1.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param _trap_max
caption = "upper border for trap"
default = 2.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param lattice
caption = "Lattice Type"
enum = "None" \
"round" "trunc" "floor" "ceil" "abs" \
"r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \
"round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \
"r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2"
default = 0
endparam

param lattFac1
caption = "Lattice Factor 1"
default = (0.1,0.0)
endparam

param lattFac2
caption = "Lattice Factor 2"
default = (0.1,0.0)
endparam

param with_zStart
caption = "zStart everywhere Y/N"
default = false
hint = "Works with the lattices"
endparam

param randomness
caption = "Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

] ; weierstrass_p_func

riemann_zeta_func [

;
;;

init:
float _dist = 0
float _rdist = 0
float _idist = 0

float _tdist = 0
float _cdist = 0
float _qdist = 0

float _rd = 0
float _id = 0

float _min_dist = 1e20
float _max_dist = -1

float _min_rdist = 1e20
float _max_rdist = -1

float _min_idist = 1e20
float _max_idist = -1

float _min_tdist = 1e20
float _max_tdist = -1

float _min_cdist = 1e20
float _max_cdist = -1

float _min_qdist = 1e20
float _max_qdist = -1

float temp = -1
; complex temp = (-1,0)

;
; Traps
;
bool _do_trap = true
float _trap = 0.01

bool _do_rtrap = true
float _rtrap = 0.01

bool _do_itrap = true
float _itrap = 0.01

bool _do_ttrap = true
float _ttrap = 0.01

bool _do_ctrap = true
float _ctrap = 0.01

;
; Sums
;
float _sum = 0
float _rsum = 0
float _isum = 0
float _tsum = 0
float _csum = 0
float _qsum = 0

int iter = 0

complex zStart = 0

complex _zz = #z ; init _zz

loop:

zStart = #z ; init zStart

;
; Start with the lattices
;
if (@lattice == 1)
zStart = round(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 2)
zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 3)
zStart = floor(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 4)
zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 5)
zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2

elseif (@lattice == 6)
zStart = round(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 7)
zStart = trunc(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 8)
zStart = floor(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 9)
zStart = ceil(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 10)
zStart = abs(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))

elseif (@lattice == 11)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 12)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 13)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 14)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 15)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*zStart^2)^2) \
- @lattFac2*zStart^2

elseif (@lattice == 16)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 17)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 18)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 19)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 20)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2

endif


_zz = zStart
iter = iter+1

;
; transformation
;

int n = 1

complex R_Fkt_z = 0

;
; Calculate the Riemann Zeta-Function
;
while (n _max_dist
_max_dist = _dist
endif

if @_mode == 6 && _rdist > _max_rdist
_max_rdist = _rdist
endif

if @_mode == 7 && _rdist > _max_rdist
_max_idist = _idist
endif

if @_mode == 8 && _tdist > _max_tdist
_max_tdist = _tdist
endif

if @_mode == 9 && _cdist > _max_cdist
_max_cdist = _cdist
endif

if @_mode == 30 && _qdist > _max_qdist
_max_qdist = _qdist
endif


;
; Calculate the traps
;

if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max
_do_trap = false
_trap =_dist
endif

if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max
_do_rtrap = false
_rtrap =_rdist
endif

if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max
_do_itrap = false
_itrap =_idist
endif

if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max
_do_ttrap = false
_ttrap =_tdist
endif

if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max
_do_ctrap = false
_ctrap =_cdist
endif


;
; Calculate the sums
;
if @_mode == 24
_sum = _sum + _dist
endif
if @_mode == 25
_rsum = _rsum + _rdist
endif
if @_mode == 26
_isum = _isum + _idist
endif
if @_mode == 27
_tsum = _tsum + _tdist
endif
if @_mode == 28
_csum = _csum + _cdist
endif
if @_mode == 31
_qsum = _qsum + _qdist
endif

final:

if @_mode == 0
temp = _min_dist ; "Min Dist"
elseif @_mode == 1
temp = _min_rdist ; "Min Real"
elseif @_mode == 2
temp = _min_idist ; "Min Imag"
elseif @_mode == 3
temp = _min_tdist ; "Min Triang"
elseif @_mode == 4
temp = _min_cdist ; "Min Cubus"

elseif @_mode == 5
temp = _max_dist ; "Max Dist"
elseif @_mode == 6
temp = _max_rdist ; "Max Real"
elseif @_mode == 7
temp = _max_idist ; "Max Imag"
elseif @_mode == 8
temp = _max_tdist ; "Max Triang"
elseif @_mode == 9
temp = _max_cdist ; "Max Cubus"

elseif @_mode == 10
temp = cabs(_zz - #pixel) ; "Act Dist"
elseif @_mode == 11
temp = abs(real(_zz-#pixel)) ; "Act Real"
elseif @_mode == 12
temp = abs(imag(_zz-#pixel)) ; "Act Imag"

elseif @_mode == 13
temp = _dist ; "Last Dist"
elseif @_mode == 14
temp = _rdist ; "Last Real"
elseif @_mode == 15
temp = _idist ; "Last Imag"
elseif @_mode == 16
temp = _tdist ; "Last Triang"
elseif @_mode == 17
temp = _cdist ; "Last Cubus"

elseif @_mode == 18
temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference"

elseif @_mode == 19
temp = _trap ; "Trap Dist"

elseif @_mode == 20
temp = _rtrap ; "Trap Real"

elseif @_mode == 21
temp = _itrap ; "Trap Imag"

elseif @_mode == 22
temp = _ttrap ; "Trap Triang"

elseif @_mode == 23
temp = _ctrap ; "Trap Cubus"


elseif @_mode == 24
temp = _sum ; "Sum Dist"

elseif @_mode == 25
temp = _rsum ; "Sum Real"

elseif @_mode == 26
temp = _isum ; "Sum Imag"

elseif @_mode == 27
temp = _tsum ; "Sum Triang"

elseif @_mode == 28
temp = _csum ; "Sum Cubus"

elseif @_mode == 29
temp = _min_qdist ; "Min MinQuot"

elseif @_mode == 30
temp = _max_qdist ; "Max MinQuot"

elseif @_mode == 32
temp = _qsum ; "Sum MinQuot"

elseif @_mode == 32
temp = _qdist ; "Last MinQuot"

endif

#index = real(@fkt(temp)) + @randomness * real(#random)

default:
title = "Riemann Zeta Function Colouring"

param _mode
caption = "Dist. Mode"
enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \
"Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \
"Act Dist" "Act Real" "Act Imag" \
"Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \
"Difference" \
"Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \
"Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \
"Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot"
endparam

param exponent
caption= "Exponent for R-Zeta"
default=1.0
endparam

param pure
caption= "With Pixel Addition"
default=TRUE
endparam

func fkt
caption = "Additional Function"
default = ident()
endfunc

param _trap_min
caption = "lower border for trap"
default = 1.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param _trap_max
caption = "upper border for trap"
default = 2.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param lattice
caption = "Lattice Type"
enum = "None" \
"round" "trunc" "floor" "ceil" "abs" \
"r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \
"round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \
"r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2"
default = 0
endparam

param lattFac1
caption = "Lattice Factor 1"
default = (0.1,0.0)
endparam

param lattFac2
caption = "Lattice Factor 2"
default = (0.1,0.0)
endparam

param with_zStart
caption = "zStart everywhere Y/N"
default = false
hint = "Works with the lattices"
endparam

param randomness
caption = "Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

] ; riemann_zeta_func

joukowskij_func [

;
;

init:
float _dist = 0
float _rdist = 0
float _idist = 0

float _tdist = 0
float _cdist = 0
float _qdist = 0

float _rd = 0
float _id = 0

float _min_dist = 1e20
float _max_dist = -1

float _min_rdist = 1e20
float _max_rdist = -1

float _min_idist = 1e20
float _max_idist = -1

float _min_tdist = 1e20
float _max_tdist = -1

float _min_cdist = 1e20
float _max_cdist = -1

float _min_qdist = 1e20
float _max_qdist = -1

float temp = -1

;
; Traps
;
bool _do_trap = true
float _trap = 0.01

bool _do_rtrap = true
float _rtrap = 0.01

bool _do_itrap = true
float _itrap = 0.01

bool _do_ttrap = true
float _ttrap = 0.01

bool _do_ctrap = true
float _ctrap = 0.01

;
; Sums
;
float _sum = 0
float _rsum = 0
float _isum = 0
float _tsum = 0
float _csum = 0
float _qsum = 0

complex _zz = #z ; init _zz

complex zStart = 0

loop:

zStart = #z ; init zStart

;
; Start with the lattices
;
if (@lattice == 1)
zStart = round(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 2)
zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 3)
zStart = floor(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 4)
zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 5)
zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2

elseif (@lattice == 6)
zStart = round(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 7)
zStart = trunc(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 8)
zStart = floor(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 9)
zStart = ceil(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 10)
zStart = abs(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))

elseif (@lattice == 11)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 12)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 13)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 14)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 15)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*zStart^2)^2) \
- @lattFac2*zStart^2

elseif (@lattice == 16)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 17)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 18)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 19)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 20)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2

endif


complex J_Fkt_z = (zStart + @epsilon/zStart)/2

if (@pure)
_zz = J_Fkt_z^@exponent
else
_zz = J_Fkt_z^@exponent + #pixel
endif

;
; Calculate distances
;
_dist = cabs(_zz - #z)
_rd = real(_zz - #z)
_id = imag(_zz - #z)

_rdist = abs(_rd)
_idist = abs(_id)

if _rd > _id
_tdist = _rdist
_cdist = _idist

if _id == 0
_qdist = _rdist
else
_qdist = _rdist / _idist
endif

else
_tdist = _idist
_cdist = _rdist

if _rd == 0
_qdist = _idist
else
_qdist = _idist / _rdist
endif
endif

;
; Calculate Min
;
if @_mode == 0 && _dist < _min_dist
_min_dist = _dist
endif

if @_mode == 1 && _rdist < _min_rdist
_min_rdist = _rdist
endif

if @_mode == 2 && _idist < _min_idist
_min_idist = _idist
endif

if @_mode == 3 && _tdist < _min_tdist
_min_tdist = _tdist
endif

if @_mode == 4 && _tdist < _min_cdist
_min_cdist = _cdist
endif

if @_mode == 29 && _qdist < _min_qdist
_min_qdist = _qdist
endif

;
; Calculate Max
;
if @_mode == 5 && _dist > _max_dist
_max_dist = _dist
endif

if @_mode == 6 && _rdist > _max_rdist
_max_rdist = _rdist
endif

if @_mode == 7 && _rdist > _max_rdist
_max_idist = _idist
endif

if @_mode == 8 && _tdist > _max_tdist
_max_tdist = _tdist
endif

if @_mode == 9 && _cdist > _max_cdist
_max_cdist = _cdist
endif

if @_mode == 30 && _qdist > _max_qdist
_max_qdist = _qdist
endif


;
; Calculate the traps
;

if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max
_do_trap = false
_trap =_dist
endif

if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max
_do_rtrap = false
_rtrap =_rdist
endif

if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max
_do_itrap = false
_itrap =_idist
endif

if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max
_do_ttrap = false
_ttrap =_tdist
endif

if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max
_do_ctrap = false
_ctrap =_cdist
endif


;
; Calculate the sums
;
if @_mode == 24
_sum = _sum + _dist
endif
if @_mode == 25
_rsum = _rsum + _rdist
endif
if @_mode == 26
_isum = _isum + _idist
endif
if @_mode == 27
_tsum = _tsum + _tdist
endif
if @_mode == 28
_csum = _csum + _cdist
endif
if @_mode == 31
_qsum = _qsum + _qdist
endif

final:

if @_mode == 0
temp = _min_dist ; "Min Dist"
elseif @_mode == 1
temp = _min_rdist ; "Min Real"
elseif @_mode == 2
temp = _min_idist ; "Min Imag"
elseif @_mode == 3
temp = _min_tdist ; "Min Triang"
elseif @_mode == 4
temp = _min_cdist ; "Min Cubus"

elseif @_mode == 5
temp = _max_dist ; "Max Dist"
elseif @_mode == 6
temp = _max_rdist ; "Max Real"
elseif @_mode == 7
temp = _max_idist ; "Max Imag"
elseif @_mode == 8
temp = _max_tdist ; "Max Triang"
elseif @_mode == 9
temp = _max_cdist ; "Max Cubus"

elseif @_mode == 10
temp = cabs(_zz - #pixel) ; "Act Dist"
elseif @_mode == 11
temp = abs(real(_zz-#pixel)) ; "Act Real"
elseif @_mode == 12
temp = abs(imag(_zz-#pixel)) ; "Act Imag"

elseif @_mode == 13
temp = _dist ; "Last Dist"
elseif @_mode == 14
temp = _rdist ; "Last Real"
elseif @_mode == 15
temp = _idist ; "Last Imag"
elseif @_mode == 16
temp = _tdist ; "Last Triang"
elseif @_mode == 17
temp = _cdist ; "Last Cubus"

elseif @_mode == 18
temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference"

elseif @_mode == 19
temp = _trap ; "Trap Dist"

elseif @_mode == 20
temp = _rtrap ; "Trap Real"

elseif @_mode == 21
temp = _itrap ; "Trap Imag"

elseif @_mode == 22
temp = _ttrap ; "Trap Triang"

elseif @_mode == 23
temp = _ctrap ; "Trap Cubus"


elseif @_mode == 24
temp = _sum ; "Sum Dist"

elseif @_mode == 25
temp = _rsum ; "Sum Real"

elseif @_mode == 26
temp = _isum ; "Sum Imag"

elseif @_mode == 27
temp = _tsum ; "Sum Triang"

elseif @_mode == 28
temp = _csum ; "Sum Cubus"

elseif @_mode == 29
temp = _min_qdist ; "Min MinQuot"

elseif @_mode == 30
temp = _max_qdist ; "Max MinQuot"

elseif @_mode == 32
temp = _qsum ; "Sum MinQuot"

elseif @_mode == 32
temp = _qdist ; "Last MinQuot"

endif

#index = real(@fkt(temp)) + @randomness * real(#random)

default:
title = "Joukowskij Function Colouring"

param _mode
caption = "Dist. Mode"
enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \
"Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \
"Act Dist" "Act Real" "Act Imag" \
"Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \
"Difference" \
"Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \
"Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \
"Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot"
endparam

param exponent
caption= "Exponent for J"
default=1.0
endparam

param epsilon
caption= "Epsilon, Coeff. for 1/z"
default=1.0
endparam

param pure
caption= "With Pixel Addition"
default=TRUE
endparam

func fkt
caption = "Additional Function"
default = ident()
endfunc

param _trap_min
caption = "lower border for trap"
default = 1.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param _trap_max
caption = "upper border for trap"
default = 2.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param lattice
caption = "Lattice Type"
enum = "None" \
"round" "trunc" "floor" "ceil" "abs" \
"r-round" "r-trunc" "r-floor" "r-ceil" "r-abs" \
"round^2" "trunc^2" "floor^2" "ceil^2" "abs^2" \
"r-round^2" "r-trunc^2" "r-floor^2" "r-ceil^2" "r-abs^2"
default = 0
endparam

param lattFac1
caption = "Lattice Factor 1"
default = (0.1,0.0)
endparam

param lattFac2
caption = "Lattice Factor 2"
default = (0.1,0.0)
endparam

param with_zStart
caption = "zStart everywhere Y/N"
default = false
hint = "Works with the lattices"
endparam

param randomness
caption = "Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

] ; joukowskij_func

agm [

init:
complex ar = |real(@fn1(#pixel))|
complex ge = |imag(@fn2(#pixel))|

complex arit = 0
complex geom = 0

int iter = 0

bool do_loop = TRUE

loop:

if (do_loop)
iter = iter +1

; Calculate new values of arithmetical
; and geometrical mean
arit = (ar+ge)/2.0
geom = sqrt(ar*ge)

; give these values back
; for the next loop-run
ar = arit
ge = geom

; stop the loop
if (|@fkt(ar)-@fkt(ge)| < @epsilon/@granulation || \
iter > @maxIter*@granulation)
do_loop = FALSE
endif
endif

final:

#index = real(@trf(iter/@granulation)) + @randomness * real(#random)


default:
title = "AGM #1 (Arithm. Geom. Mean)"

param epsilon
caption = "epsilon"
default = 0.001
min = 0.0
endparam

param granulation
caption = "Granulation"
default = 1.0
min = 0.0001
endparam

param maxIter
caption = "Maximum Iterations"
default = 60
min = 1
endparam

param randomness
caption = "Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

func fkt
caption = "Test Function"
default = ident()
endfunc

func trf
caption = "Transfer Function"
default = ident()
endfunc

func fn1
caption = "Real Part Init Function"
default = ident()
endfunc

func fn2
caption = "Imag Part Init Function"
default = ident()
endfunc

] ; agm

agm2 [

init:
float _dist = 0
float _rdist = 0
float _idist = 0

float _tdist = 0
float _cdist = 0
float _qdist = 0

float _rd = 0
float _id = 0

float _min_dist = 1e20
float _max_dist = -1

float _min_rdist = 1e20
float _max_rdist = -1

float _min_idist = 1e20
float _max_idist = -1

float _min_tdist = 1e20
float _max_tdist = -1

float _min_cdist = 1e20
float _max_cdist = -1

float _min_qdist = 1e20
float _max_qdist = -1

float temp = -1

;
; Traps
;
bool _do_trap = true
float _trap = 0.01

bool _do_rtrap = true
float _rtrap = 0.01

bool _do_itrap = true
float _itrap = 0.01

bool _do_ttrap = true
float _ttrap = 0.01

bool _do_ctrap = true
float _ctrap = 0.01

;
; Sums
;
float _sum = 0
float _rsum = 0
float _isum = 0
float _tsum = 0
float _csum = 0
float _qsum = 0

complex ar = |real(@fn1(#pixel))|
complex ge = |imag(@fn2(#pixel))|

complex arit = 0
complex geom = 0
complex _zz = #pixel

int iter = 0

bool do_loop = TRUE

loop:

if (do_loop)
iter = iter +1

; Calculate new values of arithmetical
; and geometrical mean
arit = (ar+ge)/2.0
geom = sqrt(ar*ge)

; give these values back
; for the next loop-run
ar = arit
ge = geom

; stop the loop
if (|@fkt(ar)-@fkt(ge)| < @epsilon/@granulation || \
iter > @maxIter*@granulation)
do_loop = FALSE
endif

if (_zz != 0)
_zz = _zz^iter + 1/_zz ;
endif

if (@pure)
_zz = _zz + #pixel
endif
endif

;
; Calculate distances
;
_dist = cabs(_zz - #z)
_rd = real(_zz - #z)
_id = imag(_zz - #z)

_rdist = abs(_rd)
_idist = abs(_id)

if _rd > _id
_tdist = _rdist
_cdist = _idist

if _id == 0
_qdist = _rdist
else
_qdist = _rdist / _idist
endif

else
_tdist = _idist
_cdist = _rdist

if _rd == 0
_qdist = _idist
else
_qdist = _idist / _rdist
endif
endif

;
; Calculate Min
;
if @_mode == 0 && _dist < _min_dist
_min_dist = _dist
endif

if @_mode == 1 && _rdist < _min_rdist
_min_rdist = _rdist
endif

if @_mode == 2 && _idist < _min_idist
_min_idist = _idist
endif

if @_mode == 3 && _tdist < _min_tdist
_min_tdist = _tdist
endif

if @_mode == 4 && _tdist < _min_cdist
_min_cdist = _cdist
endif

if @_mode == 29 && _qdist < _min_qdist
_min_qdist = _qdist
endif

;
; Calculate Max
;
if @_mode == 5 && _dist > _max_dist
_max_dist = _dist
endif

if @_mode == 6 && _rdist > _max_rdist
_max_rdist = _rdist
endif

if @_mode == 7 && _rdist > _max_rdist
_max_idist = _idist
endif

if @_mode == 8 && _tdist > _max_tdist
_max_tdist = _tdist
endif

if @_mode == 9 && _cdist > _max_cdist
_max_cdist = _cdist
endif

if @_mode == 30 && _qdist > _max_qdist
_max_qdist = _qdist
endif


;
; Calculate the traps
;

if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max
_do_trap = false
_trap =_dist
endif

if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max
_do_rtrap = false
_rtrap =_rdist
endif

if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max
_do_itrap = false
_itrap =_idist
endif

if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max
_do_ttrap = false
_ttrap =_tdist
endif

if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max
_do_ctrap = false
_ctrap =_cdist
endif


;
; Calculate the sums
;
if @_mode == 24
_sum = _sum + _dist
endif
if @_mode == 25
_rsum = _rsum + _rdist
endif
if @_mode == 26
_isum = _isum + _idist
endif
if @_mode == 27
_tsum = _tsum + _tdist
endif
if @_mode == 28
_csum = _csum + _cdist
endif
if @_mode == 31
_qsum = _qsum + _qdist
endif

final:

if @_mode == 0
temp = _min_dist ; "Min Dist"
elseif @_mode == 1
temp = _min_rdist ; "Min Real"
elseif @_mode == 2
temp = _min_idist ; "Min Imag"
elseif @_mode == 3
temp = _min_tdist ; "Min Triang"
elseif @_mode == 4
temp = _min_cdist ; "Min Cubus"

elseif @_mode == 5
temp = _max_dist ; "Max Dist"
elseif @_mode == 6
temp = _max_rdist ; "Max Real"
elseif @_mode == 7
temp = _max_idist ; "Max Imag"
elseif @_mode == 8
temp = _max_tdist ; "Max Triang"
elseif @_mode == 9
temp = _max_cdist ; "Max Cubus"

elseif @_mode == 10
temp = cabs(_zz - #pixel) ; "Act Dist"
elseif @_mode == 11
temp = abs(real(_zz-#pixel)) ; "Act Real"
elseif @_mode == 12
temp = abs(imag(_zz-#pixel)) ; "Act Imag"

elseif @_mode == 13
temp = _dist ; "Last Dist"
elseif @_mode == 14
temp = _rdist ; "Last Real"
elseif @_mode == 15
temp = _idist ; "Last Imag"
elseif @_mode == 16
temp = _tdist ; "Last Triang"
elseif @_mode == 17
temp = _cdist ; "Last Cubus"

elseif @_mode == 18
temp = abs(cabs(_zz)-cabs(#pixel)) ; "Difference"

elseif @_mode == 19
temp = _trap ; "Trap Dist"

elseif @_mode == 20
temp = _rtrap ; "Trap Real"

elseif @_mode == 21
temp = _itrap ; "Trap Imag"

elseif @_mode == 22
temp = _ttrap ; "Trap Triang"

elseif @_mode == 23
temp = _ctrap ; "Trap Cubus"


elseif @_mode == 24
temp = _sum ; "Sum Dist"

elseif @_mode == 25
temp = _rsum ; "Sum Real"

elseif @_mode == 26
temp = _isum ; "Sum Imag"

elseif @_mode == 27
temp = _tsum ; "Sum Triang"

elseif @_mode == 28
temp = _csum ; "Sum Cubus"

elseif @_mode == 29
temp = _min_qdist ; "Min MinQuot"

elseif @_mode == 30
temp = _max_qdist ; "Max MinQuot"

elseif @_mode == 32
temp = _qsum ; "Sum MinQuot"

elseif @_mode == 32
temp = _qdist ; "Last MinQuot"

endif

#index = real(@trf(temp)) + @randomness * real(#random)

default:
title = "AGM #2 (Arithm. Geom. Mean)"

param _mode
caption = "Dist. Mode"
enum = "Min Dist" "Min Real" "Min Imag" "Min Triang" "Min Cubus" \
"Max Dist" "Max Real" "Max Imag" "Max Triang" "Max Cubus" \
"Act Dist" "Act Real" "Act Imag" \
"Last Dist" "Last Real" "Last Imag" "Last Triang" "Last Cubus" \
"Difference" \
"Trap Dist" "Trap Real" "Trap Imag" "Trap Triang" "Trap Cubus" \
"Sum Dist" "Sum Real" "Sum Imag" "Sum Triang" "Sum Cubus" \
"Min MinQuot" "Max MinQuot" "Sum MinQuot" "Last MinQuot"
endparam

param _trap_min
caption = "lower border for trap"
default = 1.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param _trap_max
caption = "upper border for trap"
default = 2.0
min = 0.0
hint = "Only usefull with Traps"
endparam

param epsilon
caption = "epsilon"
default = 0.1
min = 0.0
endparam

param pure
caption= "With Pixel Addition"
default=TRUE
endparam

param granulation
caption = "Granulation"
default = 1.0
min = 0.0001
endparam

param maxIter
caption = "Maximum Iterations"
default = 200
min = 1
endparam

param randomness
caption = "Randomness"
hint = "This adds a random texture to the coloring."
default = 0.0
endparam

func fkt
caption = "Additional Function"
default = recip()
endfunc

func trf
caption = "Transfer Function"
default = ident()
endfunc

func fn1
caption = "Real Part Init Function"
default = ident()
endfunc

func fn2
caption = "Imag Part Init Function"
default = ident()
endfunc

] ; agm2

agm3 [

;
;

init:
float _dist = 0
float _rdist = 0
float _idist = 0

float _tdist = 0
float _cdist = 0
float _qdist = 0

float _rd = 0
float _id = 0

float _min_dist = 1e20
float _max_dist = -1

float _min_rdist = 1e20
float _max_rdist = -1

float _min_idist = 1e20
float _max_idist = -1

float _min_tdist = 1e20
float _max_tdist = -1

float _min_cdist = 1e20
float _max_cdist = -1

float _min_qdist = 1e20
float _max_qdist = -1

float temp = -1

;
; Traps
;
bool _do_trap = true
float _trap = 0.01

bool _do_rtrap = true
float _rtrap = 0.01

bool _do_itrap = true
float _itrap = 0.01

bool _do_ttrap = true
float _ttrap = 0.01

bool _do_ctrap = true
float _ctrap = 0.01

;
; Sums
;
float _sum = 0
float _rsum = 0
float _isum = 0
float _tsum = 0
float _csum = 0
float _qsum = 0

complex ar = |real(@fn1(#pixel))|
complex ge = |imag(@fn2(#pixel))|

complex arit = 0
complex geom = 0
complex _zz = #pixel

int iter = 0

bool do_loop = TRUE

complex zStart = 0

loop:

zStart = #z ; init zStart

;
; Start with the lattices
;
if (@lattice == 1)
zStart = round(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 2)
zStart = trunc(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 3)
zStart = floor(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 4)
zStart = ceil(@lattFac1*zStart) - @lattFac2*zStart
elseif (@lattice == 5)
zStart = abs(@lattFac1*zStart) - @lattFac2*zStart^2

elseif (@lattice == 6)
zStart = round(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 7)
zStart = trunc(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 8)
zStart = floor(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 9)
zStart = ceil(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))
elseif (@lattice == 10)
zStart = abs(@lattFac1*zStart) \
- @lattFac2*sqrt(real(zStart)*imag(zStart))

elseif (@lattice == 11)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 12)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 13)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 14)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*zStart)^2) \
- @lattFac2*zStart^2
elseif (@lattice == 15)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*zStart^2)^2) \
- @lattFac2*zStart^2

elseif (@lattice == 16)
zStart = round((round(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 17)
zStart = trunc((trunc(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 18)
zStart = floor((floor(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 19)
zStart = ceil((ceil(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2
elseif (@lattice == 20)
zStart = abs((abs(@lattFac1*zStart) \
- @lattFac1*sqrt(real(zStart)*imag(zStart)))^2) \
- @lattFac2*zStart^2

endif

_zz = zStart

if (do_loop)
iter = iter +1

; Calculate new values of arithmetical
; and geometrical mean
arit = (ar+ge)/2.0
geom = sqrt(ar*ge)

; give these values back
; for the next loop-run
ar = arit
ge = geom

; stop the loop
if (|@fkt(ar)-@fkt(ge)| < @epsilon/@granulation || \
iter > @maxIter*@granulation)
do_loop = FALSE
endif

if (_zz != 0)
_zz = _zz^iter + 1/_zz ;
endif

if (@pure)
_zz = _zz + #pixel
endif
endif

;
; Calculate distances
;
_dist = cabs(_zz - #z)
_rd = real(_zz - #z)
_id = imag(_zz - #z)

_rdist = abs(_rd)
_idist = abs(_id)

if _rd > _id
_tdist = _rdist
_cdist = _idist

if _id == 0
_qdist = _rdist
else
_qdist = _rdist / _idist
endif

else
_tdist = _idist
_cdist = _rdist

if _rd == 0
_qdist = _idist
else
_qdist = _idist / _rdist
endif
endif

;
; Calculate Min
;
if @_mode == 0 && _dist < _min_dist
_min_dist = _dist
endif

if @_mode == 1 && _rdist < _min_rdist
_min_rdist = _rdist
endif

if @_mode == 2 && _idist < _min_idist
_min_idist = _idist
endif

if @_mode == 3 && _tdist < _min_tdist
_min_tdist = _tdist
endif

if @_mode == 4 && _tdist < _min_cdist
_min_cdist = _cdist
endif

if @_mode == 29 && _qdist < _min_qdist
_min_qdist = _qdist
endif

;
; Calculate Max
;
if @_mode == 5 && _dist > _max_dist
_max_dist = _dist
endif

if @_mode == 6 && _rdist > _max_rdist
_max_rdist = _rdist
endif

if @_mode == 7 && _rdist > _max_rdist
_max_idist = _idist
endif

if @_mode == 8 && _tdist > _max_tdist
_max_tdist = _tdist
endif

if @_mode == 9 && _cdist > _max_cdist
_max_cdist = _cdist
endif

if @_mode == 30 && _qdist > _max_qdist
_max_qdist = _qdist
endif


;
; Calculate the traps
;

if @_mode == 19 && _do_trap && _dist > @_trap_min && _dist < @_trap_max
_do_trap = false
_trap =_dist
endif

if @_mode == 20 && _do_rtrap && _rdist > @_trap_min && _rdist < @_trap_max
_do_rtrap = false
_rtrap =_rdist
endif

if @_mode == 21 && _do_itrap && _idist > @_trap_min && _idist < @_trap_max
_do_itrap = false
_itrap =_idist
endif

if @_mode == 22 && _do_ttrap && _tdist > @_trap_min && _tdist < @_trap_max
_do_ttrap = false
_ttrap =_tdist
endif

if @_mode == 23 && _do_ctrap && _cdist > @_trap_min && _cdist < @_trap_max
_do_ctrap = false
_ctrap =_cdist
endif


;
; Calculate the sums
;
if @_mode == 24
_sum = _sum + _dist
endif
if @_mode == 25
_rsum = _rsum + _rdist
endif
if @_mode == 26
_isum = _isum + _idist
endif
if @_mode == 27
_tsum = _tsum + _tdist
endif
if @_mode == 28
_csum = _csum + _cdist
endif
if @_mode == 31
_qsum = _qsum + _qdist
endif

final:

if @_mode == 0
temp = _min_dist ; "Min Dist"
elseif @_mode == 1
temp = _min_rdist ; "Min Real"
elseif @_mode == 2
temp = _min_idist ; "Min Imag"
elseif @_mode == 3
temp = _min_tdist ; "Min Triang"
elseif @_mode == 4
temp = _min_cdist ; "Min Cubus"

elseif @_mode == 5
temp = _max_dist ; "Max Dist"
elseif @_mode == 6
temp = _max_rdist ; "Max Real"
elseif @_mode == 7
temp = _max_idist ; "Max Imag"
elseif @_mode == 8
temp = _max_tdist ; "Max Triang"
elseif @_mode == 9
temp = _max_cdist ; "Max Cubus"

elseif @_mode == 10
temp = cabs(_zz - #pixel) ; "Act Dist"
elseif @_mode == 11
temp = abs(real(_zz-#pixel)) ; "Act Real"
elseif @_mode == 12
temp = abs(imag(_zz-#pixel)) ; "Act Imag"

elseif @_mode == 13
temp = _dist ; "Last Dist"
elseif @_mode == 14
temp = _rdist ; "Last Real"
elseif @_mode == 15
temp = _idist ; "Last Imag"
elseif @_mode == 16
temp = _tdist ; "Last Triang"
elseif @_mode == 17
temp = _cdist ; "Last Cubus"

elseif @_mode == 18
temp = abs(cabs(_zz)-cabs(#pixel)) ;



It has run fine for me though the code could probably be a little quicker for forming the equation.

Have fun remember post some off your formuli ,we could maybe team up for the monthly



posted on Jan, 18 2003 @ 06:28 PM
link   
Can you please help me find a keygen or cr*ck for the wonderful ultra fractal 3 (or even 3.01)?

I really like the software for uf2.05, and would like to use uf3.01 or uf3.

Thanks heaps.



posted on Jan, 19 2003 @ 11:44 AM
link   

Originally posted by bunkadoo
Can you please help me find a keygen or cr*ck for the wonderful ultra fractal 3 (or even 3.01)?

I really like the software for uf2.05, and would like to use uf3.01 or uf3.

Thanks heaps.



name: bunkadoo
number: 1647576568




top topics
 
0

log in

join