앞선.사이.벗.그림

fractal2

글쓴이
조용식
쓴날
2000-04-21 08:59
본수
10301

fractal3.jpg

dmj-SelectPhoenixJulia {
;
; This formula "selects" a portion of the image,
; based on the iteration count for the Phoenix set
; at each pixel.
;
transform:
complex y = (0,0)
complex newz = (0,0)

complex z = #pixel
int i = 0

WHILE (|z| < @bailout && i < @maxiter)
newz = z^@power1 + z^@power2 * @seed + @induct * y
y = z
z = newz
i = i + 1
ENDWHILE

float r = real(@xfer(flip(flip(i))))
r = r - trunc(r / @divisor) * @divisor
IF (r < @remainder || r >= @remainder+@width)
#solid = TRUE
ENDIF

default:
title = "Select (Phoenix Julia)"

param maxiter
caption = "Maximum Iterations"
default = 150
hint = "Maximum number of iterations that will be performed \
for the transform."
endparam
param seed
caption = "Julia Seed"
default = (0.56667,0)
hint = "This is the Julia seed, a constant parameter which \
defines the shape of the fractal."
endparam
param power1
caption = "Primary Exponent"
default = (2,0)
hint = "Defines the primary exponent for the fractal. The classic \
Phoenix curve uses exponent 2."
endparam
param power2
caption = "Secondary Exponent"
default = (0,0)
hint = "Defines the secondary exponent for the fractal. The classic \
Phoenix curve uses exponent 0."
endparam
param induct
caption = "Phoenix Distortion"
default = (-0.5,0)
hint = "Sets how 'strong' the previous iteration's effect should be \
on the fractal."
endparam
param bailout
caption = "Bailout"
default = 1.0e20
hint = "Defines how soon an orbit bails out, i.e. doesn't belong \
to the Phoenix set anymore."
endparam
param divisor
caption = "Iteration Divisor"
default = 2.0
hint = "The iteration count will be divided by this value, and \
the remainder taken."
endparam
param remainder
caption = "Iteration Remainder"
default = 1.0
hint = "If the remainder after dividing the iteration count \
does not match this value, the pixel will be colored \
'solid'."
endparam
param width
caption = "Band Width"
default = 1.0
hint = "The width of the non-solid band, in iterations."
endparam
func xfer
caption = "Iteration Transfer"
default = ident()
hint = "This function will be applied to the iteration count \
before it is divided."
endfunc
}

dmj-Twirl {
;
; Ripple Transformation
; This transform will add ripples to a fractal.
; Add multiple transforms for interference effects.
;
transform:
complex center2 = @twirlcenter
IF (@centermove)
center2 = #center
ENDIF
float d = cabs(#pixel-center2)
IF (d < @twirlfade)
IF (@twirltype == 0) ; side to side
#pixel = (#pixel-center2) * (0,1) ^ (cos(d*@twirlpitch*#pi) * @twirlscale * sqr(1-d/@twirlfade)) + center2

ELSEIF (@twirltype == 1) ; forward and back
#pixel = (#pixel-center2) * (1 - cos(d*@twirlpitch*#pi) * @twirlscale * sqr(1-d/@twirlfade)) + center2

ELSEIF (@twirltype == 2) ; in and out
float d2 = atan(imag(#pixel-center2)/real(#pixel-center2))
IF (real(d2) < 0) ; pointing to left
d2 = d2 + #pi ; rotate 180 degrees
ENDIF
IF (d2 < 0) ; negative angle (we want 0 < atan < pi*2)
d2 = d2 + #pi * 2 ; rotate 360 degrees
ENDIF
#pixel = (#pixel-center2) * (1 - cos(d2*@twirlpitch) * @twirlscale * sqr(1-d/@twirlfade)) + center2

ELSEIF (@twirltype == 3) ; back and forth
float d2 = atan(imag(#pixel-center2)/real(#pixel-center2))
IF (real(d2) < 0) ; pointing to left
d2 = d2 + #pi ; rotate 180 degrees
ENDIF
IF (d2 < 0) ; negative angle (we want 0 < atan < pi*2)
d2 = d2 + #pi * 2 ; rotate 360 degrees
ENDIF
#pixel = (#pixel-center2) * (0,1) ^ (cos(d2*@twirlpitch) * @twirlscale * sqr(1-d/@twirlfade)) + center2

ENDIF
ENDIF

default:
title = "Ripples"
param twirlcenter
caption = "Ripple Center"
default = (0,0)
hint = "Sets the center of the ripples."
endparam
param centermove
caption = "Use Screen Center"
default = TRUE
hint = "If set, ripples will be around the center of \
the window, regardless of the Ripple Center \
setting."
endparam
param twirlscale
caption = "Ripple Strength"
default = 0.25
hint = "Sets the height of the ripples."
endparam
param twirlpitch
caption = "Ripple Frequency"
default = 10.0
min = 0.0
hint = "Frequency of ripples; higher values will give \
more densely packed ripples."
endparam
param twirlfade
caption = "Ripple Fade"
default = 1.0
min = 0.00000001
hint = "Distance at which ripples fade."
endparam
param twirltype
caption = "Ripple Type"
default = 1
enum = "Side to Side" "Forward and Back" "In and Out" "Back and Forth"
hint = "Orientation of ripples with respect to the \
ripple center."
endparam
}

dmj-Unspiral {
;
; This undoes a spiral, straightening the arms.
; You will have to play a bit to get this to
; exactly match. You can of course also use this
; to APPLY a spiral transformation. 🙂
;
transform:
complex center2 = @spicenter
IF (@centermove)
center2 = #center
ENDIF
complex z2 = #pixel - center2
#pixel = (z2)*(0,1)^(log(cabs(z2))*@spipower) + center2

default:
title = "Unspiral"

param spicenter
caption = "Spiral Center"
default = (0,0)
hint = "Sets the center of the spiral. Use the eyedropper \
to pick the center of the spiral."
endparam
param centermove
caption = "Use Screen Center"
default = TRUE
hint = "If set, the spiral is assumed to be at the center of \
the window, regardless of the Spiral Center setting."
endparam
param spipower
caption = "Spiral Power"
default = 1.0
hint = "Sets the 'tightness' of the spiral. Tweak this until \
the spiral arms are straight."
endparam
}
zl 7
 ^ + ..
 
*J2loY oloz
 L   L   -T
         D2