代码太吓人了:
KleinianLimitSets {
; modified june 2009, original June 2006 Ronald Barnett
;
; Based upon the depth-first tree search algorithm in the book \
; Indra's Pearls by Mumford, Series and Wright. It is considerably faster \
; than most other algorithms in generating the limit set.
; modified Feb 2010 to allow mapping transforms to work.
;
global:
import "common.ulb"
import "reb.ulb"
Circle C = new Circle(0,0)
Circle cir[4]
Mobius gen[4]
MobiusArray word = new MobiusArray(@level)
complex cs[4]
float rad[4]
int tag[]
setlength(tag,@level)
这个应该可以用几何画板来做一下:
ESAFractalTree {
;
; version 1.0
; By Etienne Saint-Amant, 2002/07/02
;
; Go to http://ESAfractal.com for examples and tutorial
;
; Based on FractalTree
; By Samuel Monnier, 11.1.00
; Modified with his kind permission
;
init:
z = 0
float arg = 0
int i = 0
float j = 0
float d = 0
float dist = 1e5
float x = 0
float y = 0
float imagCof = @imaginaryCoefficient
if @mode == 0
z = #pixel
endif
float dr = pi/@rotincrCoefficient*@rotincr/@altitudeTree
loop:
if @mode == 1
i = i + 1
if i == @itertr
z = #z
endif
endif
final:
; Performs translation, rotation
; and magnification
z = z - @center
z = z*exp(-1i*@rot*pi/@rotationchange)
z = z/@size
i = 0
while i < @niter
i = i + 1
imagCof = imagCof + @alterimaginary
x = abs(real(z))
y = imag(z)
z = x + imagCof * 1i * y
arg = -atan2(z) + pi/@weirdness
; Estimate distance
if y >= -1 && y <= 0
d = x^@power
elseif y < -1
d = cabs(z + imagCof * 1i)^@power
elseif y > 0
d = cabs(z)^@power
endif
if d < dist
dist = d
endif
; Computes the rotation to apply
j = @order-1
rotincr = j*dr
while j > 0
j = j - 2
if arg < (j+1)*dr
rotincr = j*dr
endif
endwhile
; Performs transformation
z = z*exp(imagCof*1i*rotincr)
z = z*@magnincr
z = z - imagCof*1i
;parameter added by ESA
param imaginaryCoefficient
caption = "Imaginary Coefficient"
default = 0.75
hint = "Imaginary Coefficient to change the shape of the branches (default .75)"
endparam
;parameter added by ESA
param alterimaginary
caption = "Alter Imaginary Coefficient"
default = 0.1
hint = "Alter the Imaginary Coefficient for each iteration (default 0.1)"
endparam
;parameter added by ESA
param altitudeTree
caption = "Altitude Tree"
default = 2.0
hint = "Create a tree developing more vertically (default 2.0)"
endparam
;parameter added by ESA
param weirdness
caption = "Weirdness"
default = 2.2
hint = "Weirdness (default 2.2)"
endparam
;parameter added by ESA
param rotincrCoefficient
caption = "Rotation Incrementation"
default = 120
hint = "Rotation Incrementation Coefficient (default 120)"
endparam
;parameter added by ESA
param rotationchange
caption = "Rotation Change"
default = 50
hint = "Rotation Change (default 50)"
endparam
}