5-sided Sierpinski Gasket
2008.05.22
Mathematics, Pictures/Images, Programming

While in the stall attending to some personal business today, I read the graffiti as usual. One particular one is a pretty poor attempt at an Apollonian gasket. Somehow from there I started wondering if it is possible to construct Apollonian gaskets with five-fold symmetry (in particular, I was seeing if I can draw a gasket such that instead of having hyperbolic triangles left over, we have all hyperbolic pentagons).

The question can be (sort of) reduced to one in planar graphs, in particular the tiling of a pentagon by smaller pentagons. Once I see this, I realized that this allows a way to construct an analogue to the Sierpinski gasket using pentagons.

Here's a rough illustration: Illustration of the pentagonal Sierpinski gasket

Here's how I drew it: I first discovered the PERL module PostScript::Simple (interested parties can search for thatn on CPAN). Then I wrote this simple (ugly and inelegant, probably with lots of inefficiencies) script with a single recursion:

use strict;
use PostScript::Simple;

my $p = new PostScript::Simple(colour => 1, eps => 1, units => "pt", xsize => 1000, ysize => 1000);

my @pa = (500,100);
my @pb = (200,300);
my @pc = (325,650);
my @pd = (675,650);
my @pe = (800,300);

$p->polygon( @pa, @pb, @pc, @pd, @pe, @pa);

iterDrawPenta(8,@pa,@pb,@pc,@pd,@pe);
$p->output("test.eps");


sub iterDrawPenta {
if ($_[0] == 0){ return; }
my @points = @_[1..10];
my @points2 = @_[3..10,1,2];
my @points3 = @_[5..10,1..4];
my @points4 = @_[9,10,1..8];
my @outside;
my @inside;

for (my $k = 0; $k < 5; $k ++){
push(@outside, ($points[2*$k] + $points2[2*$k])/2);
push(@outside, ($points[2*$k+1] + $points2[2*$k+1])/2);
push(@inside, ((2*$points[2*$k] + $points4[2*$k])/3 + (2*$points2[2*$k] + $points3[2*$k])/3)/2);
push(@inside, ((2*$points[2*$k+1] + $points4[2*$k+1])/3 + (2*$points2[2*$k+1] + $points3[2*$k+1])/3)/2);
$p->line(@outside[2*$k,2*$k+1],@inside[2*$k,2*$k+1]);
}

$p->polygon(@inside, @inside[0,1]);
iterDrawPenta( $_[0] - 1, @points[0,1], @outside[0,1], @inside[0,1], @inside[8,9], @outside[8,9]);
iterDrawPenta( $_[0] - 1, @points[2,3], @outside[2,3], @inside[2,3], @inside[0,1], @outside[0,1]);
iterDrawPenta( $_[0] - 1, @points[4,5], @outside[4,5], @inside[4,5], @inside[2,3], @outside[2,3]);
iterDrawPenta( $_[0] - 1, @points[6,7], @outside[6,7], @inside[6,7], @inside[4,5], @outside[4,5]);
iterDrawPenta( $_[0] - 1, @points[8,9], @outside[8,9], @inside[8,9], @inside[6,7], @outside[6,7]);
}

The script uses the PostScript::Simple module and starts by initiating an eps canvas. The five arrays pa,pb,pc,pd,pe are the initial starting coordinates for the pentagon. The main drawing is done by the sub-routine iterDrawPenta which divides the input-pentagon into 6 sub-pentagons, and recursively calls itself, inputting the 5 outer sub-pentagons. The leading parameter of iterDrawPenta keeps track of the level of recursion.

The figure above was drawn using 8 levels of recursion, which produced a 79 megabyte postscript file, which I then converted to a much smaller png image.

Posted at 21:17:49 EDT by W comment

blogCentralFront Page
2008.09.25 15:38:39 EDT Some thoughts on Christodoulou's Formation of Black Holes This has gotta be the quickest I've ever read a paper. After about 2 weeks (8 working days to be exact), I finished "reading" (to be more precise, I skimmed the paper without checking all of the calcu
2008.09.18 14:46:02 EDT The "inverse" of a decreasing, right-continuous function is also decreasing and right-continuous A small math theorem that it took me an embarrassing long while to prove. Quite trivial actually. Theorem Let m be a function from R+ to R+ that is decreasing and continuous on the right. Define f fro
2008.09.10 15:58:02 EDT Some news Good news: With the weather pretty nice outside, it doesn't take long to bike over to the Institute of Advanced Studies. I took it easy on the way over, and the ride was 15 minutes from Fine Hall to S
2008.07.13 22:59:15 EDT Kerr-Newman paper posted on arXiv Finally! I have changed from a consumer of scientific progress to a producer thereof: my first respectable paper has been posted to arXiv. It is on "A space-time characterization of the Kerr-Newman me
2008.07.02 23:10:39 EDT Fireworks after moving in For some reason, Princeton Township decided to run its firework display this evening. Not exactly on the same calibre as the one given next to the Charles with the music of Boston Pop, but still quite
2008.06.27 18:46:15 EDT Honeymoon pictures I have returned from my Honeymoon in Britain. There will be text-based descriptions a bit later, after my wife and I sort out some more mundane details about moving into a new apartment, getting car f
2008.06.08 23:48:09 EDT It's finally sinking in... I am no longer a bachelor! By the great noodly appendages of the flying spaghetti monster, I am a married man! Ceremony was great, people were awesome. More detail to follow tomorrow or Tuesday.
2008.05.22 21:17:49 EDT 5-sided Sierpinski Gasket While in the stall attending to some personal business today, I read the graffiti as usual. One particular one is a pretty poor attempt at an Apollonian gasket. Somehow from there I started wondering
2008.04.30 11:06:36 EDT Walk the plank! As the accusation of problems with Sequoia voting machines that were used in this past Presidential Primary escalate, I think I more and more agree with what Practicality says in regards to Sequoia's
2008.04.24 15:37:35 EDT On Doron Zeilberger Scanning through the offered seminars today, I came across an entry that I've already mostly missed (in part because my office hourse): Between 2:15pm and 3:15pm today, Professor Doron Zeilberger of