A fractal leaf and the Sierpinski triangle

an applet made by António Miguel de Campos (Portugal)

Fractal leaf
The fractal leaf is generated by starting with a point at the origin (x=0, y=0) and iteratively determining new points by applying 4 different coordinate transformation formulas:
1.
x=0
y=0.16*y
2.
x=0.2*x-0.26*y
y=0.23*x+0.22*y+1.6
3.
x=-0.15*x+0.28*y
y=0.26*x+0.24*y+0.44
4.
x=0.85*x+0.04*y
y=-0.04*x+0.85*y+1.6
The first formula moves any original point to a place on a vertical line segment on the y axis. In screen (by selecting "4 colors" and "rect") we can see in yellow the segment which results from the transformation of all the points inside the white rectangle. The application of this formula occurs only 1% of times.


The second formula moves any original point inside the white rectangle to a place inside the red rectangle. It corresponds to a reduction in size, followed by a left rotation, followed by a shift upwards. The application of this formula occurs only 7% of times.
The initial 1.6 value in this formula can be changed by altering the selected value in «shift» (initially 160, which corresponds to 0.01*160=1.6).


The third formula moves any original point inside the white rectangle to a place inside the blue rectangle. It corresponds to a reduction in size, a reversal in respect to the y axis and a right rotation, followed by a shift downwards. The application of this formula occurs only 7% of times.


Finally, the fourth formula moves any original point inside the white rectangle to a place inside the cyan rectangle. It corresponds to a small reduction in size and a small rotation to the right, followed by a shift upwards. The application of this formula occurs 85% of times and its application generates most of the leaf.
The initial 0.04 value in this formula can be changed by altering the selected value in «angle» (initially 4, which corresponds to 0.01*4=0.004). The initial 1.6 value in this formula can be changed by altering the selected value in «size» (initially 160, which corresponds to 0.01*160=1.6).
Sierpinski triangle
The Serpinski is generated by starting with a point at the origin (x=0, y=0) and iteratively determining new points by applying 3 different coordinate transformation formulas:
x=0.5*x

x=0.5*x+0,5

x=0.5*x+1

y=0,5*y

y=0,5*y+0,5

y=0,5*y

All of them generate half-reduced copies but the second places the copy to the right and up and the third to the right, at a double distance.
Try to put the values 44, 88 e 22 in the three text fields, in that order, from the left to the right. The result looks like a thai palace!

Notice that each triangle gives rise to 3 triangles with half dimension. It is a fractal object of fractal dimension 1.58 (ln(3)/ln(2)). [If there were 4 triangles, it would be ln(4)/ln(2)=2 and we would have a «normal» 2 dimension object.]

Lorenz atractor - the butterfly effect in a strange atractor  

Fractal figures generated using L-systems 

Wall paper-errors due to finite precision