Message Boards Message Boards

GROUPS:

[GIF] Microcosm (Stereographic projection of cube grid)

Posted 10 months ago
1521 Views
|
1 Reply
|
3 Total Likes
|

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!

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