Message Boards Message Boards

GROUPS:

[GIF] Shock (Spinning squares)

Posted 2 years ago
2848 Views
|
1 Reply
|
2 Total Likes
|

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, π}]
 ]

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!

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