Message Boards Message Boards

[GIF] Stepper (Two tessellations)

Two tessellations

Stepper

This is obviously the same basic idea as Reinvention, but with eight spokes rather than six.

Two possibly confusing definitions in the following code:

  1. The quantity $r$ defines the length of the spokes, which varies between $1$ and $\sec(\pi/8) \approx 1.08239$. The latter is the length needed to make sure spokes connect in the quadrilaterals-and-octagons configuration, but leads to unpleasant visual artifacts if it isn't decreased to $1$ when switching configurations.
  2. The function $f(x)$ is $1$ minus $e^{-7x/16}\left[ \cos\left(\frac{3\sqrt{23}}{16}x\right) + \frac{1}{2} \sin \left(\frac{3\sqrt{23}}{16}x\right)\right]$, which is a solution of the (under-)damped harmonic oscillator equation $y'' + \frac{7}{8}y' +y=0$.

Anyway, here's the code:

DynamicModule[{n = 8, cols, f, t, r},
 cols = RGBColor /@ {"#08D9D6", "#FF2E63", "#252A34"};
 f[x_] := 
  1 - E^(-7 x/16) Cos[(3 Sqrt[23] x)/16] - 
   1/2 E^(-7 x/16) Sin[(3 Sqrt[23] x)/16];
 Manipulate[
  t = ?/8 f[s] + ?/8 f[Clip[s - 20, {0, 20}]];
  r = (1 - f[s] + f[Clip[s - 20, {0, 20}]]) (1 - Sec[?/8]) + 
    Sec[?/8];
  Graphics[{Thickness[.01], CapForm["Round"], 
    Table[Line[{x, 2 y + (-1)^x/2} + # & /@ {{0, 0}, 
        r {Cos[? + (-1)^x t], Sin[? + (-1)^x t]}}, 
      VertexColors -> {cols[[1]], 
        Blend[Join[#, #] &[cols[[;; 2]]], 
         1/3 f[s] + 1/3 f[Clip[s - 20, {0, 20}]]]}], {x, -3, 
      3}, {y, -3.25, 2.75}, {?, 0, 2 ? - 2 ?/n, 
      2 ?/n}]}, PlotRange -> 3, ImageSize -> 540, 
   Background -> cols[[3]]], {s, 0, 40}]
 ]

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