Message Boards Message Boards

[GIF] Microcosm (Stereographic projection of cube grid)

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

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it 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