Message Boards Message Boards

[GIF] Group Work (Families of rhombuses)

Families of rhombuses

Group Work

Continuing to riff on this basic idea (cf. 1, 2). Here's the code:

rhombus[{x_, y_}, ?_, ?_] := 
  Polygon[{x, y} + # & /@ 
      Prepend[{#[[1]], #[[1]] + #[[2]], #[[2]]}, {0, 
        0}] &[{{Cos[?], 
      Sin[?]}, {Cos[? + ?], 
      Sin[? + ?]}}]];
basicblock[{x_, y_}, ?_, t_, n_] := 
 Table[{rhombus[{x, y}, ?, ? + t], 
   rhombus[{x + Cos[? + t] + Cos[? + t + ?], 
     y + Sin[? + t] + 
      Sin[? + t + ?]}, ?, ? + 
     2 ?/3]}, {?, 0, 2 ? - 2 ?/n, 2 ?/n}]

DynamicModule[{cols},
 cols = RGBColor /@ {"#A9EEE6", "#FEFAEC", "#F38181", "#625772"};
 Manipulate[
  Graphics[{FaceForm[None], 
    EdgeForm[Directive[JoinForm["Round"], Thickness[.0065]]], 
    Table[{EdgeForm[cols[[Mod[x + y + Floor[y/2], 3, 1]]]], 
      basicblock[{4 x + (-1)^y, 2 Sqrt[3] y}, 2 ? Haversine[t], 0,
         3][[;; , 2]]}, {x, -3, 3}, {y, -3, 3}]}, 
   PlotRange -> {{-9, 11}, {-6 Sqrt[3] - .1, 6 Sqrt[3] - .1}}, 
   ImageSize -> 540, Background -> cols[[4]]], {t, 0, ?}]
 ]

enter image description here - another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the tops of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract