Fractals using iterated function systems,
with affine transformations
ACCESS
July 2001
> restart:#fractals use a lot of memory
> Digits:=4:
#number of significant digits - this will
#make computations go faster without sacrificing
#visual accuracy - because IFS’s are self correcting.
> with(plots):
#we want to be able to see our fractals
Warning, the name changecoords has been redefined
The next procedure will take a point P=[x,y]) in the plane and let us compute its image under an affine
transformation.
We use the same letters for the transformation parameters as we did in the class notes:
=
AFFINE1
x
y
+
ab
cd
x
y
e
f
> AFFINE1:=proc(X,a,b,c,d,e,f)
RETURN(evalf([a*X[1]+b*X[2]+e,
c*X[1]+d*X[2]+f]));
end:
>
You should check that these are the transformations for the Sierpinski triangle
> f1:=P->AFFINE1(P,.5,0,0,.5,.25,.5);
f2:=P->AFFINE1(P,.5,0,0,.5,.5,0);
f3:=P->AFFINE1(P,.5,0,0,.5,0,0);