MCPcopy Create free account
hub / github.com/ActiveState/code / IFS

Function IFS

recipes/Python/578048_IFS_fractal/recipe-578048.py:58–62  ·  view source on GitHub ↗
(x, y, i)

Source from the content-addressed store, hash-verified

56## [0.333, 0.0, 0.0, 0.333, 0.666, 0.333, 0.125]]
57
58def 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
64m = len(mat) # number of IFS transformations
65# find xmin, xmax, ymin, ymax of the fractal using IFS algorithm

Callers 1

recipe-578048.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected