Sunday, November 30, 2008

Hi, my name is Roice... and I crochet


Picture me and Sarah sitting side by side in bed around 11:30 pm, her knitting, me crocheting, and you'll have a pretty good idea of a number of evenings of ours over the last few weeks.  Maybe not the most exciting image, but we've been having fun.  I've finished my first crochet project now, a portion of a hyperbolic plane with radius of curvature of about 5 cm, and I think it turned out pretty good.  The crocheted rows are quite visible in this picture I snapped.  Are they geodesics of the surface? *

I'm sure I'll learn more by playing with it, but I've learned some already, not the least of which is that I can't count to 5.  All I had to do was 5 normal stitches for every doubled-up stitch, and I'd say 60% of the time I lost my place!  And boy are programmers spoiled with undo.  Too bad that functionality isn't available in the physical universe.

Something noteworthy about this particular construction (but not a property of hyperbolic geometry itself) has to do with the fact that the number of stitches in successive rows forms a geometric sequence, that is the length of each row is a constant multiple of the previous row.  That has some unintuitive side effects.  I did 23 rows total, the first had 20 stitches and took maybe a minute, but the last had over 1000 stitches and took almost 3 hours!  If I were to do another 23 rows, the final 46th row would take me over 28 days (no sleep, no breaks) and who knows how many skeins of yarn.  Add yet another 23, and the final row would take over 5 years.  This reminds me of "the magic of compounding interest", and what I've been told the value stocks are supposed to do in theory.

Speaking of economic unraveling, this leads to something else intriguing about my hyperbolic plane.  Instead of tying off the end when I was done, I could have undone the entire uber-knot in one fell swoop just by pulling out my crochet hook and gently pulling on the yarn.  It's like the whole thing is a house of cards, a deceivingly stable form that is actually no more substantial than the first slip knot that started the whole thing.  This reminds me of the axiomatic foundations of mathematics.

While working on this, I couldn't help but focus on a possible useful application.  I haven't figured it out yet, but my mind can't let go of the idea that this could solve the widespread problem of competition for blankets when couples sleep.  The extra material seems like a perfect candidate to provide some benefit here :)

* Nope.  If they were, I would be able to fold the surface so that they appeared flat and straight.

Sunday, November 16, 2008

Sarah Goes Hyperbolic


Sarah has been knitting some pretty scarfs lately. She was showing off her latest project to me, and lo and behold it turned out to be mathematical! As she was knitting successive rows, she added incremental stitches to give it a ruffled appearance. I told her I thought this was especially cool because the extra stitches were giving the scarf a negative curvature. It was hyperbolic! That is what happens when you try to put extra material into what would otherwise be a flat 2 dimensional surface.  She lovingly rolled her eyes :)

Every time I think I have a new idea, it turns out someone has already been there, done that.  On the plus side, the article I then tracked down already contained developed information and instructions for crocheting your very own hyperbolic plane.  Following the directions will result in a hyperbolic surface of constant negative curvature (Sarah's scarfs don't adhere to the constant part).  I also found this site with some nice pictures of completed crochetings (the site mentions the work of Daina Taimina, who is one of the authors of the paper above).

It is interesting to note that if you build a constant negative curvature surface large enough, it will necessarily end up intersecting itself in our 3D world.  Models living in our physical universe are limited in their representation.  This is in contrast to models of constant positive curvature surfaces, which do fit nicely into the world.  The surface of any ball will do.

Sarah and I just returned from Hill Country Weavers, where Sarah bought me a crochet hook, so I'm now off to attempt creating my own hyperbolic plane!

update:  Sarah did not aprove the cuteness factor of my first picture, so I've uploaded an improved version.

Saturday, November 8, 2008

Loxodromes!

This is a sweet word used to describe a sweet mathematical curve. And by sweet I mean awesome and one of my favorites. Speaking of favorites, I learned about these curves in my favorite mathematical book, Visual Complex Analysis, by Tristan Needham. If this post piques your interest, there is tons more about them there.


Loxodromes are curves of motion you get from certain kinds of Mobius transformations, whose general algebraic definition is the formula (az+b)/(cz+d).  z is a complex number here, that is a point in a plane. Hence, these transformations can be viewed visually by their effects on the points of a plane. However, Mobius transforms have an elegant interpretation when viewed as a corresponding transform obtained by unprojecting the plane onto a sphere (doing the reverse of stereographic projection that I described in a previous post), as the resulting motions on the sphere are much simpler! The sphere is called the Riemann Sphere in honor of Bernhard Riemann.

In this animation, I put a little white fuzzball near the north pole of the sphere to show the light generating the shadows. The shadows are the 3D->2D stereographic projection of the curve on the sphere. So this is two simultaneous views of a loxodrome, both on the sphere and on the plane (fine print: not exactly because the curve I've drawn has a little bit of thickness coming off the sphere surface, but the shadows are still close). If you remember the previous discussion in the soap bubble post about projecting from 4D->3D, hopefully that process is a little more clear by analogy now. We may not be able to look at 4D objects in our world, but we can look at their shadows! Anyway, I hope this shed a little more light (pun intended) on what stereographic projection is.

Loxodromes correspond to one of the more general types of Mobius transform motions, and the animation can help a little in explaining what I mean by that. Watch it for a bit and answer the following: Do you see the curve stretching and shrinking over the sphere like it is moving from one end of the spiral towards the other? Or do you see the curve as unchanging its shape and just rotating as a whole about an axis through the 2 spiral ends?

My perception is biased to the former, but there is no right answer because it could be viewed either way! The first kind of motion is called hyperbolic (unfortunately, the meaning here is not the same as of the last post), and the second is called elliptic. Both are special types of Mobius transformations, and loxodromes are what you get when you do both in combination. Incidentally, it is interesting that I have trouble seeing this as a rotating curve because that is how the POV-Ray script actually generated the sequence of images :)


Recognize the projected shape in this picture? A special case of the projection of a loxodrome onto the plane is a logarithmic, or equiangular spiral! Yes, the spiral of sea shells and galaxies and so much more. Are you feeling the awesomeness yet? By the way, I took advantage of this to simplify making the movie. There are no complex number calculations explicitly going on, just a function that can generate points of a logarithmic spiral on a plane, and a function that can unproject those points from the plane to a sphere. So if you were thinking it was terribly involved to generate the movie and picture, it actually was not so bad (though it did take a long time to render out the frames). The entire definition file is only about 100 lines, with half of it standard required stuff (camera position, etc.). Here it is if you care to check it out.  POV-Ray is great! 

Wednesday, October 29, 2008

Hyperbolic Tiling in Motion

I've seen a number of pretty images of hyperbolic tessellations (tilings) on the web. A nice gallery from one of the producers of the Dimensions videos turns many flat Escher tilings into hyperbolic ones. What I hadn't seen until I went looking the other day was a way to animate motions of the hyperbolic plane (using the Poincare Disk model).

I thought this would be a cool project, and decided to do a quick search to see what applets out there might already be doing it. I was pleased to find this one right at the top of the search results (and even more pleased because I know the author Don Hatch through the Rubik hypercube group and was able to meet him some time ago...wow actually that was almost a decade ago...scary).










Drag your mouse around on his applet above to see this tiling of the hyperbolic plane translate (update: Sarah let me know this doesn't work in Google Reader btw). This can give a much better feel than a static picture that each tile in the image is actually the same shape (a regular polygon). I know this post is lacking in background, but hyperbolic geometry can't be represented through normal plane geometry without distortion, hence there are alternate representations with tradeoffs in characteristics. One thing to notice is that the white tiles have 7 sides and the dual blue tiling has 7 triangles meeting around a point, but you can't have such a tiling in normal space with a set of regular triangles (7*60>360). There just isn't enough space, kinda like our closet storage for Sarah's shoes :)

This applet is highly configurable and fun to play with, e.g. click on it and start pressing p. You can find all the info on Don's applet page. There are some extensions I would still like to see in addition to translations. A rotation of the plane about any selected point would be cool. Hyperbolic geometry is more interesting than flat (Euclidean) geometry, leading to more possibilities as well. Specifically there is a special kind of rotation called a limit rotation, and this would also be neat to see. Finally, it would be sweet to allow animated motions of other models of hyperbolic geometry like the half plane model. So there is still fun potential hobby coding to be done (of course).

Tuesday, October 28, 2008

World of Goo

Against one of the stereotypical traits of those practicing my chosen profession, strangely I have never been much of a gamer, at least not since junior high school. In truth, I haven't bought a video game in years, but last weekend I did! (And it wasn't even a racing game.) It is a physics game, but you might never realize it. The art and music are both extremely cool, and there is one song I wish I had in my iTunes library. Here is a review that will do it more justice than I could.



They have a free demo, which was more than enough for me to want to support these two guys, who are only asking $20 for the full version as well...excellent joy-to-price ratio. The main site is here, which has some nice trailers if you'd like to see more before downloading the demo. Thanks Rob for pointing me to this one :)

Sunday, October 19, 2008

Soap Bubbles

I've been playing around with POV-Ray in the background quite a bit since my first post about it. I spent a lot of evening hours hanging out with Sarah in front of the tv working on a soap bubble effect (I had no idea this would turn into the diversion it did), and I wanted to share my best effort on it so far :)


It took some obsessiveness to get this far. Sarah was helpful, and after a number of iterations I'm sure she tired of being shown sets of two ever-so-slightly-different pictures to choose the best one. Luckily she humors me.

I want to share a little more about this picture because I wasn't thinking about rendering soap bubbles at all when starting it. That really was just a diversion. I am interested in projections from 4D to 3D of the hypersphere (the four dimensional mathematical analogue of a familiar sphere) because I am trying to understand that object better. Just like a sphere in 3D, this is the set of points that is a fixed distance from a center point, only in a higher space. (I feel the need to give some background - an ordinary sphere is a surface of dimension 2 that lives in 3 dimensions.  A hypersphere is a 3 dimensional object, and mathematicians call these the 2-sphere and 3-sphere, respectively - the names can lead to confusion because in an everyday sense most think of a sphere as a 3D object rather than a 2D one.  Spheres don't even have to be embedded in a higher dimensional space, but that is a digression here.)

I'm going to continue to blab a bit, but stay with me (or just skim this paragraph) because the most interesting part I want to share is at the end of this post...  We can't stereographically project every point of the hypersphere from 4D down to 3D (the resulting set of points would cover all of 3D space plus one more point at infinity, and hence the full projection doesn't help my unfailing need to see pictures of things to understand them). So we try to do the best we can by looking at discrete subsets of points (and lines, and surfaces) of the hypersphere. The picture above is one such subset, a regular tiling of the hypersphere called an 8-cell, and is more commonly known as the hypercube. This is one way of representing the hypercube anyway, which involves first stretching the edges of the 4D cube outwards so they lie on the hypersphere (causing them to be curved), then stereographically projecting that from 4D to 3D. I'll (hopefully) explain more about stereographic projection when I share a short animation I've been working on in POV-Ray (if you're too excited to hold your breath for that, check out dimensions-math.org for some excellent and free downloadable videos. I recommend those regardless!!).  Some more cool properties about the picture above... All the edges are "great circles" of the hypersphere, and all the bubble surfaces are "great spheres" of the hypersphere. Stereographic projection preserves circles and spheres, meaning a shape that is a circle in 4-space before the projection is still a circle after the projection. How cool is that? (Before you go on an extrapolation binge like I always do, know that the centers of the circles and spheres are not preserved during projection though, i.e. the center of a projected circle is not the projection of the center of the corresponding unprojected circle.  Peter piper picked a peck of pickled peppers.)

No worries if the above didn't make too much sense, but let me share something really astonishing about all this. Amazingly, you can make the shape of a hypercube like this picture in our real 3D universe with real bubbles because of the way bubbles try to minimize their surface area! Here is a youtube video showing a bubble performer make a "square bubble". But taking the above into consideration, the performance is really is much more spectacular than a square bubble. Using only bubbles, he's effectively projected a 4D object (a regular polychoron) for us to see and admire! This is truly magical and a nice example of the unreasonable effectiveness of mathematics in describing our physical universe.

We can theoretically "project" more complicated tilings of the hypersphere using bubbles as well. Though I don't imagine a bubble magician could pull this one off, here is a computer rendering of the 120-cell in bubbles.

Couple all this with Sarah discovering it is tons of fun to blow bubbles off our balcony, and there are smiles all around :)

(btw, sorry for all the parentheses (I can't seem to help myself (it's what I do)))

Saturday, October 18, 2008

Between the Folds

Sarah and I watched a neat documentary blending art and mathematics on Thursday night. There are many interesting and endearing characters in this story, and we both really liked it. It is an hour long and you can watch it online, but only this weekend as part of the Hamptons International Film Festival. If you don't catch it there, I recommend bookmarking the film site so you can see it at some point (they have a trailer at that link btw).