Message Boards Message Boards

[GIF] School’s Out (Stereographic projection of random sphere paths)

Stereographic projection of random sphere paths

School’s Out

This one is very much the same idea as Pathways: basically, a bunch of random points on the sphere undergoing two simultaneous random rotations. There are three main differences: (i) more points; (ii) all points are chosen from the positive orthant; (iii) I'm applying stereographic projection to map the points down to the plane.

Of course, that means we need to define stereographic projection:

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

And then to generate a bunch of random points and two random rotation axes:

spherepoints = Abs /@ Normalize /@ RandomVariate[NormalDistribution[], {100, 3}];
n = Normalize /@ RandomVariate[NormalDistribution[], {2, 3}];

And then put everything together:

With[{cols = RGBColor /@ {"#fdff01", "#6cf068", "#000018"}},
 Manipulate[
  Graphics[
   {Thickness[.006], CapForm["Round"],
    Line[Stereo /@ #,
       VertexColors ->
        Table[
         Directive[Blend[cols[[;; 2]], t/25], Opacity[1 - t/200]], {t, 0, 200}]]
      & /@ 
     Transpose[
      Table[spherepoints.RotationMatrix[2 ?, 
         n[[1]]].RotationMatrix[3 ?, n[[2]]],
       {?, -s, ?/4 - s, ?/800}]]},
   ImageSize -> 540, PlotRange -> 2, Background -> cols[[-1]]],
  {s, 0, 2 ?}]
 ]

If you really want to play around with the exact points and axes I used, you can unzip this file and load them from the resulting files using the following commands:

Get["spherepoints.ws"];
Get["n.ws"];

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! 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