Message Boards Message Boards

GROUPS:

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

Posted 8 months ago
1339 Views
|
3 Replies
|
6 Total Likes
|

Voronoi cells of stereographically projected loxodrome points

Loxo

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},
   Flatten[
    Table[
     1/Sqrt[1 + t^2] {Cos[t + θ + #], Sin[t + θ + #], -t} &[RandomVariate[NormalDistribution[0, .0001]]],
     {θ, 0., 2 π - 2 π/n, 2 π/n}, {t, -60., 
      60, .2}],
    1]
   ];

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"}},
 Manipulate[
  VoronoiMesh[
   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, π}
  ]
 ]
3 Replies

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 8 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

POSTED BY: Arm Mo
Answer

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

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