Message Boards Message Boards

[GIF] Microcosm (Stereographic projection of cube grid)

GROUPS:

Stereographic projection of cube grid

Microcosm

This is conceptually very simple: take a $7 \times 7$ grid of unit cubes in space, normalize to the unit sphere, stereographically project to the plane, then apply a rotation to the original grid of cubes. Here's the code:

Stereo[p_] := 1/(1 - p[[-1]]) p[[;; 2]];

With[{n = 3, cols = RGBColor /@ {"#4EEAF6", "#291F71"}},
 Manipulate[
  Graphics[
   {Opacity[.5], CapForm[None], cols[[1]], Thickness[.006],
    Line[
     Flatten[
      Transpose[
       Table[
        Stereo[Normalize[#]] & /@
         {{t, 
           y Cos[θ] - z Sin[θ], 
           z Cos[θ] + y Sin[θ]},
          {y, t Cos[θ] - z Sin[θ], 
           z Cos[θ] + t Sin[θ]},
          {y, z Cos[θ] - t Sin[θ], 
           t Cos[θ] + z Sin[θ]}},
        {z, -n - 1/2, n + 1/2}, {y, -n - 1/2, n + 1/2}, {t, -n - 1/2.,
          n + 1/2, 1/20}],
       {2, 3, 4, 1, 5}],
      2]
     ]
    },
   PlotRange -> 1, Axes -> False, ImageSize -> 540, Background -> cols[[-1]]],
  {θ, 0, π/2}]
 ]
POSTED BY: Clayton Shonkwiler
Answer
23 days ago

Group Abstract Group Abstract