Advertisement
Guest User

smooth carpet

a guest
Jun 7th, 2019
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. f[m_] := Map[
  2. ({{1 - #, 1 - #^2, 1 - #}, {1 - #^2, 1 - #, 1 - #^2}, {1 - #,
  3. 1 - #^2, 1 - #}}) &
  4. , m,
  5. {2}];
  6. next[m_] := ArrayFlatten[f[m]];
  7. n = 5;
  8. img[p_] := (
  9. ArrayPlot[
  10. Nest[next, {{p}}, n], ColorFunction -> "Rainbow",
  11. ColorFunctionScaling -> False,
  12. PixelConstrained -> True,
  13. ImageSize -> {3^n, 3^n}]);
  14. Manipulate[
  15. img[p],
  16. {p, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement