Advertisement
Matthen

Pretty Hexagons

May 19th, 2013
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. randomhexagon[] := {Opacity[0.05 + 0.5 RandomReal[]],
  2. ColorData["DarkBands"][RandomReal[]],
  3. Polygon[RandomChoice[
  4. Range[1, 4]] Table[{Sin[\[Theta]], Cos[\[Theta]]}, {\[Theta], 0,
  5. 2 Pi, 2 Pi/6}]]};
  6. Graphics[
  7. Table[
  8. Translate[randomhexagon[], {Sqrt[3] (x + Mod[y, 2]/2), y 1.5}],
  9. {x, 21}, {y, 13}]
  10. , ImageSize -> 800, PlotRange -> {Sqrt[3] {1, 21}, 1.5 {1, 13}}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement