Group Abstract Group Abstract

Message Boards Message Boards

[GIF] Part of the Journey (Conformally transformed hex circle packing)

4 Replies
Posted 8 years ago

It feels slightly weird to be name-checked by Clayton at the outset. :) I will try hard at this.

First, a preliminary subroutine (whose derivation was slightly unwieldy even with Mathematica at hand):

moebiusDisk[{{a_, b_}, {c_, d_}}, {z0_, r_}] := With[{den = Abs[c z0 + d]^2 - Abs[r c]^2}, 
       Disk[ReIm[((a z0 + b) Conjugate[c z0 + d] - a Conjugate[c] r^2)/den], r Abs[b c - a d]/den]]

which, as might be ascertained, will generate a new Disk[] object corresponding to the Möbius transformation of Disk[ReIm[z0], r].

With this, we can now write a Manipulate[] version:

With[{?1 = 2., ?2 = 2. I, z? = 8.5 Exp[I ?/3], h = 1/50, 
      cols = RGBColor /@ {"#f3e551", "#add85d", "#65bcb7", "#5d8cd2",
                          "#c374af", "#e2574d", "#e2762f", "#0D2C54"}},
     Manipulate[Graphics[
                Table[If[! (MatchQ[a, -1 | 0] && MatchQ[b, 7 | 8 | 9]),
                         {cols[[Mod[b, 7, 1]]], moebiusDisk[{{?1 + ?2 - z?, -?1 ?2}, {1., -z?}},
                                                            {t + a + b Exp[? I/3.], 0.5}]},
                         Nothing], {a, -35, 13}, {b, -30, 18}],
                 PlotRange -> 4, ImageSize -> 540, Background -> cols[[-1]]],
                 {t, 0, 1 - h, h}, SaveDefinitions -> True]]
POSTED BY: J. M.

I should point out that this business:

If[a == 0 || a == -1, DeleteCases[Range[-30, 18], c_ /; c == 7 || c == 8 || c == 9], Range[-30, 18]]

is to delete the disks which have a point in their interior get mapped to infinity (which should turn the disk inside-out, but Polygon[] doesn't work that way, and you just get a giant solid blob covering everything else).

enter image description here - Congratulations! This post is now a Staff Pick as distinguished on your profile! Thank you, keep it coming!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard