Message Boards Message Boards

[GIF] Loxo (Voronoi cells of stereographically projected loxodrome points)


Voronoi cells of stereographically projected loxodrome points


This is very similar to the idea in Caught; here I'm generating a bunch of points on 10 different (congruent) loxodromes on the sphere, rotating the sphere, stereographically projecting the points to the plane, then forming the Voronoi cells of the resulting point set. The idea comes from Vincent Pantaloni's misinterpretation of what was going on in Caught; he thought I was using loxodromes, which I wasn't but seemed like a cool idea.

Anyway, to create the animation, first we need the stereographic projection function:

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

Next, we need the points on 10 loxodromes:

pts = With[{n = 10},
     1/Sqrt[1 + t^2] {Cos[t + θ + #], Sin[t + θ + #], -t} &[RandomVariate[NormalDistribution[0, .0001]]],
     {θ, 0., 2 π - 2 π/n, 2 π/n}, {t, -60., 
      60, .2}],

The RandomVariate[] business is superfluous mathematically, but helps prevent VoronoiMesh[] from failing. Here's a visualization of those points on the sphere:

Loxodromic points on the sphere

And then, finally, we can put the animation together:

With[{cols = RGBColor /@ {"#DA0463", "#283149"}},
   Stereo[RotationMatrix[θ, {1., 0, 0}].#] & /@ pts,
   {{-4.1, 4.1}, {-4.1, 4.1}},
   PlotTheme -> "Lines", PlotRange -> 4, ImageSize -> 540, Background -> cols[[-1]], 
   MeshCellStyle -> {{1, All} -> Directive[Thickness[.005], cols[[1]]]}],
  {θ, 0, π}
POSTED BY: Clayton Shonkwiler
4 months ago

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
4 months ago

This is so cool, thanks for the great work. Can you tell me which Mathematica version did you write this code ? I tried to used Mathematica 9 but it seems it doesn't recognize VoronioMesh and MeshCellStyle function

4 months ago

I'm on Mathematica 11, and it looks like VoronoiMesh and MeshCellStyle were both introduced in Mathematica 10.

POSTED BY: Clayton Shonkwiler
4 months ago

Group Abstract Group Abstract