(x, y, i)
| 56 | ## [0.333, 0.0, 0.0, 0.333, 0.666, 0.333, 0.125]] |
| 57 | |
| 58 | def IFS(x, y, i): # apply ith transformation to given point |
| 59 | x0 = x * mat[i][0] + y * mat[i][1] + mat[i][4] |
| 60 | y = x * mat[i][2] + y * mat[i][3] + mat[i][5] |
| 61 | x = x0 |
| 62 | return (x, y) |
| 63 | |
| 64 | m = len(mat) # number of IFS transformations |
| 65 | # find xmin, xmax, ymin, ymax of the fractal using IFS algorithm |