jlb
Class JLB_GnarlContraction
Object
common:Generic
mmf:Contraction
jlb:JLB_GnarlContraction
class
- Contraction:JLB_GnarlContraction
The Gnarl formula from mt.ufm with minor changes, as a Contraction.
Ultra Fractal Source
Toggle UF Source Code Display
class JLB_GnarlContraction(mmf.ulb:Contraction) {
; The Gnarl formula from mt.ufm with minor changes, as a Contraction.
public:
import "common.ulb"
func JLB_GnarlContraction(Generic pparent)
Contraction.Contraction(pparent)
m_rot = cos(@theta*#pi/180) + flip(sin(@theta*#pi/180))
endfunc
; @param pz
; @param pc
; @return the new pz
complex func Iterate(complex pz, complex pc)
float xc
float yc
if (@ctype == "z")
xc = real(pz)
yc = imag(pz)
elseif (@ctype == "c")
xc = real(pc)
yc = imag(pc)
else;if (@ctype == "pixel")
xc = real(#pixel)
yc = imag(#pixel)
endif
complex zrot = pz * m_rot
float x = real(zrot)
float y = imag(zrot)
float dx
float dy
if (@mode == 0)
dx = real(@a1*@f1(@b1*y + @a2*@f2(@b2*y + @a3*@f3(@b3*y)))+@c*yc)
dy = real(@a1*@f1(@b1*x + @a2*@f2(@b2*x + @a3*@f3(@b3*x)))+@c*xc)
else
dx = real(@a1*@f1(@b1*y) + @a2*@f2(@b2*y) + @a3*@f3(@b3*y)+@c*yc)
dy = real(@a1*@f1(@b1*x) + @a2*@f2(@b2*x) + @a3*@f3(@b3*x)+@c*xc)
endif
if (@xop=="-")
dx = -dx
endif
if (@yop=="-")
dy = -dy
endif
return pz + @step * (dx + flip(dy))
endfunc
protected:
complex m_rot
default:
title = "Gnarl"
int param v_Gnarlcontraction
caption = "Version (Gnarl_Contraction)"
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_Gnarlcontraction < 100
endparam
param mode
caption = "mode"
enum = "f(f(f()))" "f()+f()+f()"
default = 0
endparam
complex param a1
caption = "a1"
default = 1
endparam
complex param b1
caption = "b1"
default = 1
endparam
func f1
caption = "f1"
default = cos()
endfunc
complex param a2
caption = "a2"
default = 2.7
endparam
complex param b2
caption = "b2"
default = 2.7
; visible=( (@a1*@a2) != 0)
endparam
func f2
caption = "f2"
default = sin()
visible=( (@a1*@a2) != 0)
endfunc
complex param a3
caption = "a3"
default = 0
endparam
complex param b3
caption = "b3"
default = 1
; visible=( (@a1*@a2*@a3) != 0)
endparam
complex param c
caption = "c"
default = 1.0
endparam
param ctype
enum = "z" "c" "pixel"
caption = "c multiplier"
default = 0
endparam
param step
caption = "Step size"
default = 0.1
endparam
func f3
caption = "f3"
default = sin()
; visible=( (@a1*@a2*@a3) != 0)
endfunc
param xop
enum = "+" "-"
default = 1
endparam
param yop
enum = "+" "-"
default = 0
endparam
float param theta
caption = "Theta"
default = 0
endparam
}
Methods inherited from class Object |
|
JLB_GnarlContraction
public JLB_GnarlContraction(Generic pparent)
JLB_GnarlContraction
public JLB_GnarlContraction()
Iterate
public complex Iterate(complex pz,
complex pc)
- Overrides:
Iterate
in class Contraction
- Parameters:
pz
- pc
-
- Returns:
- the new pz