| (* Data Driven IFS - Four Bins *) |
| Off[General::spell]; |
| Off[General::spell1]; |
| dlst = {}; |
| (* paste the data between the {} in dlst = {}, comma separated numbers *) |
| dmax = Max[dlst]; |
| dmin = Min[dlst]; |
| drng = dmax - dmin; |
| f[1,x_,y_]:={0.5*x, 0.5*y} |
| f[2,x_,y_]:={0.5*x + 0.5, 0.5*y} |
| f[3,x_,y_]:={0.5*x, 0.5*y + 0.5} |
| f[4,x_,y_]:={0.5*x + 0.5, 0.5*y + 0.5} |
| ptlst={PointSize[.01]}; |
| pt={0.5,0.5}; |
| Do[{x=pt[[1]], y=pt[[2]],ind = Min[4, 1+Floor[4*(dlst[[j]] - dmin)/drng]], pt = f[ind,x,y], ptlst = Flatten[{ptlst,Point[pt]}]}, {j,1,Length[dlst]}]; |
| Show[Graphics[{ptlst, Line[{{0,0},{1,0},{1,1},{0,1},{0,0}}], Line[{{0.25,0},{0.25,1}}], Line[{{0.5,0},{0.5,1}}], Line[{{0.75,0},{0.75,1}}], Line[{{0,0.25},{1,0.25}}], Line[{{0,0.5},{1,0.5}}], Line[{{0,0.75},{1,0.75}}]}], AspectRatio->1, PlotRange->{{0,1},{0,1}}] |
| (* Data Driven IFS - Nine Bins *) |
| Off[General::spell]; |
| Off[General::spell1]; |
| dlst = {}; |
| (* paste the data between the {} in dlst = {}, comma separated numbers *) |
| dmax = Max[dlst]; |
| dmin = Min[dlst]; |
| drng = dmax - dmin; |
| f[1,x_,y_]:={0.333*x, 0.333*y} |
| f[2,x_,y_]:={0.333*x + 0.333, 0.333*y} |
| f[3,x_,y_]:={0.333*x + 0.667, 0.333*y} |
| f[4,x_,y_]:={0.333*x, 0.333*y + 0.333} |
| f[5,x_,y_]:={0.333*x + 0.333, 0.333*y + 0.333} |
| f[6,x_,y_]:={0.333*x + 0.667, 0.333*y + 0.333} |
| f[7,x_,y_]:={0.333*x, 0.333*y + 0.667} |
| f[8,x_,y_]:={0.333*x + 0.333, 0.333*y + 0.667} |
| f[9,x_,y_]:={0.333*x + 0.667, 0.333*y + 0.667} |
| ptlst={PointSize[.01]}; |
| pt={0.5,0.5}; |
| Do[{x=pt[[1]], y=pt[[2]],ind = Min[9, 1+Floor[9*(dlst[[j]] - dmin)/drng]], pt = f[ind,x,y], ptlst = Flatten[{ptlst,Point[pt]}]}, {j,1,Length[dlst]}]; |
| Show[Graphics[{ptlst, Line[{{0,0},{1,0},{1,1},{0,1},{0,0}}], Line[{{0.333,0},{0.333,1}}], Line[{{0.667,0},{0.667,1}}], Line[{{0,0.333},{1,0.333}}], Line[{{0,0.667},{1,0.667}}]}], AspectRatio->1, PlotRange->{{0,1},{0,1}}] |