Showing posts with label coloring book. Show all posts
Showing posts with label coloring book. Show all posts

Tuesday, May 12, 2009

boolean Adelaide


Just a little follow-up post to my Adelaide Venn diagram post. I wanted to double-check its correctness, so I made this diagram showing whether each set was included or not. Color by numbers!

Thursday, April 30, 2009

Slouching towards Adelaide

At some point when I was in grad school I became aware of some work on symmetric Venn diagrams. If you google this, you will find this link, which has been maintained but not changed too much since 1997. Other than that, there isn't a lot on the web and there is a particular lack of quantitative direction on how to construct the beautiful rotationally symmetric Venn diagrams such as Adelaide. This was named by Anthony Edwards after the city in which he discovered it. I have always wanted to go to Adelaide, it holds a strange attraction for me, so perhaps that is why that particular 7-set Venn diagram stuck in my head.

When I started working on my coloring book, I immediately thought of the Adelaide diagram but I didn't know how to construct it. After some mistakes today, I think I finally have it down. Here is a colored version:



Code (in Sage) for some version of this will be in the final coloring book.

Thursday, January 22, 2009

Integral Apollonian Packings with Sage

At the national math meetings this year I heard about some really interesting and fun work on integral Apollonian circle packings. The AMS has a nice introductory article about them. I couldn't resist trying to compute and draw some in Sage. Carl Witty greatly improved the speed of my first attempt, so what follows can be considered joint work of ours. (Sage can compute nicer PDF output of these, but blogger doesn't embed PDFs.)



def kfun(k1,k2,k3,k4):
"""
The Descartes formula for the curvature of an inverted tangent circle.
"""
return 2*k1+2*k2+2*k3-k4

def circfun(c1,c2,c3,c4):
"""
Computes the inversion of circle 4 in the first three circles.
"""
newk = kfun(c1[3],c2[3],c3[3],c4[3])
newx = (2*c1[0]*c1[3]+2*c2[0]*c2[3]+2*c3[0]*c3[3]-c4[0]*c4[3])/newk
newy = (2*c1[1]*c1[3]+2*c2[1]*c2[3]+2*c3[1]*c3[3]-c4[1]*c4[3])/newk
if newk > 0:
newr = 1/newk
elif newk < 0:
newr = -1/newk
else:
newr = Infinity
return [newx, newy, newr, newk]

def mcircle(circdata, label = False, thick = 1/10):
"""
Draws a circle from the data. label = True
"""
if label==True and circdata[3] > 0 and circdata[2] > 1/2000:
lab = text(str(circdata[3]),(circdata[0],circdata[1]), fontsize = \
500*(circdata[2])^(.95), vertical_alignment = 'center', horizontal_alignment \
= 'center', rgbcolor = (0,0,0))
else:
lab = Graphics()
circ = circle((circdata[0],circdata[1]), circdata[2], rgbcolor = (0,0,0), \
thickness = thick)
return circ+lab

def add_circs(c1, c2, c3, c4, cutoff = 300):
"""
Find the inversion of c4 through c1,c2,c3. Add the result to circlist,
then (if the result is big enough) recurse.
"""
newcirc = circfun(c1, c2, c3, c4)
if newcirc[3] < cutoff:
circlist.append(newcirc)
add_circs(newcirc, c1, c2, c3)
add_circs(newcirc, c2, c3, c1)
add_circs(newcirc, c3, c1, c2)

zst1 = [0,0,1/2,-2]
zst2 = [1/6,0,1/3,3]
zst3 = [-1/3,0,1/6,6]
zst4 = [-3/14,2/7,1/7,7]

circlist = [zst1,zst2,zst3,zst4]
add_circs(zst1,zst2,zst3,zst4)
add_circs(zst2,zst3,zst4,zst1)
add_circs(zst3,zst4,zst1,zst2)
add_circs(zst4,zst1,zst2,zst3)

sum([mcircle(q, label = True, thick = 1/2) for q in \
circlist]).save('./Apollonian3.png',axes = False, figsize = [12,12], xmin = \
-1/2, xmax = 1/2, ymin = -1/2, ymax = 1/2)

Monday, December 15, 2008

Coloring book reject

The image below is a Groebner fan that is just too complicated to put in the coloring book, buts I think its pretty impressive:



The ideal generating this is from what I call the "super three-vortex problem", the equations for the central configurations of a 1/r^2 potential:



I am mainly interested in the nonzero solutions of this system. To get at those, we can saturate the ideal - or in practical terms we can introduce a new variable, w, and add the equation w*s12*s13*s23 - 1 = 0 to the ideal. The 3D Groebner fan of the resulting system can be seen here.

Thursday, December 4, 2008

A mathematical coloring book

I've been working on a mathematical coloring book, with the pictures created using Sage. It still needs some work but I've put a preliminary version up at lulu.com. (I am not making any money on it, the cost is what lulu.com charges to print it.) I have also made the download freely available. I would appreciate feedback, especially from people with kids who try it out.

Sunday, November 23, 2008

Symmetric Venn Diagram

This was the start of a small industry of making symmetric Venn diagrams, which Branko Grunbaum found in 1975. I have been working on making a mathematical coloring book (first edition should be - needs to be - done by the holidays, so more details on that soon). I've been trying to making some symmetric Venn diagrams for it, this is a by-product of my first attempts: