Message Boards Message Boards

[GIF] Shock (Spinning squares)

GROUPS:

Spinning squares

Shock

Just a simple one this time, though I amused myself with the use of Norm[a, Infinity].

Here's the code:

With[{
  n = 5,
  cols = RGBColor /@ {"#48F3DB", "#51C4E9", "#4A3764", "#4A3764"}},
 Manipulate[
  Graphics[{EdgeForm[Directive[cols[[-2]], Thickness[.003]]],
    Table[
     {FaceForm[
       Blend[Reverse@cols[[;; 2]], Haversine[2 t - (ArcTan[p[[1]], p[[2]]] + π)]]],
      Polygon[
       Sqrt[2] {p[[1]], p[[2]]} + # & /@ 
        CirclePoints[{1, π/4 + π/2 (Haversine[Mod[t - ArcTan[p[[1]], p[[2]]]/2, π]] + Floor[(t - 1/2 ArcTan[p[[1]], p[[2]]])/π])}, 4]]},
     {p, DeleteCases[Tuples[Range[-n + 1, n - 1], 2], a_ /; Norm[a, Infinity] <= 1]}]},
   PlotRange -> n Sqrt[2] + 2, ImageSize -> 540, Background -> cols[[4]]],
  {t, 0, π}]
 ]
POSTED BY: Clayton Shonkwiler
Answer
10 months ago

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 top of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

POSTED BY: Moderation Team
Answer
10 months ago

Group Abstract Group Abstract