Spirographs and the third dimension

January 14, 2010

Toral Spirograph

The basic geometric ideas are straight lines and circles. The famous compass and straight edge.  There is a great deal that can be done with just these, but what if you want something more complex? Spirographs are a very simple idea, let one circle run around a second. You can make the circles as cogs and then you get a classic toy. In mathematics there is a mess of names to describe the curves produced, I shall just list them, understanding the differences is a good way of learning the subject: epicycloid, hypocycloid, epitrochoid, hypotrochoid. It is easy to find lots of examples of these curves online.

So where can we go to generalise. The first trick is to add more circles. Adding circles like this gave one of the first predictive models of the planets as they move in their strange paths across the sky.  Unfortunately if you add enough circles you can actually get any curve you want, so the method could never be disproved, though it was eventually replaced starting with the brilliance of Copernicus who put forward a model of the solar system with the sun at the center. To make images with more than two circle you obviously need a more complicated device as the circles might bump into each other (just think of three cogs). Luckily humanity was up to the challenge and produced the geometric chuck.

Three Circles 2d: (1,7) + (51,10) + (52,10)

Now we want to go further, to try to make similar figures in 3d. The first step is to get tools we can play with more easily than simply describing the geometry. We need a more algebraic form that we can give to the computer, and some way of simply describing the circles. The geometry comes first.  Here are the cogs:

The sizes of the two cogs show how fast they go round each other. In this case, we have a cog with 30 pegs and a cog with 10. The smaller cog will therefore go round 3 times every time it goes once round the big cog.  We now look at the red point on the smaller cog and watch it move along the green line.  How do we model this?

Firstly lets consider circles. We have the circles for the two cogs, but these are not very useful. We can look instead at the grey circle. The centre of the small cog moves round this circle. The black circle on the small cog then shows how the red dot moves. The final position is the position on the two circles added together. To plot the curve we need to consider both circles moving round. If we let the big circle go round once, the small circle will go round four times (once for the large circle rotating and three going round the large circle).  We also need to know the sizes of the two circles, in this case 5 and 1 (I will not give units as only the relative sizes effect the shape).  The path given by these cogs can therefore be encoded as (1,5) + (4,1).

Now recall the parametric formula for a circle: (sin(x),cos(x)), for x between 0 and 2 \pi. This equation allow a computer to draw a circle as we put in values of x and plot the point in 2d. Adding the two circles together therefore we get a parametric formula:

5 (sin(x), (cos(x))+(sin(4x),cos(4x)) = (5 sin(x) + sin (4x), 5 cos(x) + cos (4x))

Note how we would just get the points in the circle repeated four times from the second part (sin(4x),cos(4x)), were it not for the addition. We can therefore consider epicycles as adding circles of different radii, moving at different speeds, together.

Finally we can get to the title and leap to 3d. We can have circles in 3d, so lets add them together. We have an additional problem however. Circles are flat, so the same circle can be put in 3d at different angles, we must also consider the plane in which each circle lies. If we put all circles in the same plane we are stuck in 2d, so where can we put them?

One simple solution is to put the three circles on the faces of a cube:

Cube face epicycles: Left: (2,1)+(17,1)+(23,1) Right: (2,1)+(17,2)+(19,3)

There is something unsatisfying about these curves. For one thing the circles moving on faces reminds more of Lissajous curves rather than spirographs. Although we are adding circles it is hard to see where the cogs might be. Maybe another approach is required. A different approach would be to consider cogs with 45 degree angles. In other words one gear is at right angles to the previous one:

45˚cogs

Each circle other than the first now moves on a plane that itself is moving, staying at right angles to the plane of the previous circle.  It takes a bit of thinking to work out what is happening! So lets cut to two more items from my mathematical museum of dreams:

3d cog spirographs

3d cog spirographs: Left: (1,10)+(20,20)+(61,3) Right: (20,10)+(1,20)+(1,30)+(21,20)

Even better a real version (the work of Richard Grimes):

3d Spirograph by Richard Grimes

[Update: 15/1/10 Daniel Piker has a beautiful animation showing how the circles move for yet another version of the 3d spirograph]

So far we have assumed that we take circles in 2d to circles in 3d. Is this the only analogue of a circle? The circle is a one dimensional object. In two dimensions, therefore it has one less dimension than the space. Perhaps we can consider two dimensional objects when we go to three dimensions. There are two natural two dimensional generalisations of the circle: the sphere and the torus (donut). The torus can be thought of one circle moved round a second, as you can see here the red circles can be moved round the blue circle to make the torus:

As the torus is made up of circles it is perhaps more natural in this setting. We then have five pieces of information to describe a torus. The radii of the two circles and the speed at which we travel round them plus (as with circles) the plane the larger circle lies on.  Playing with these (and again adding two or more tori together gives some very nice objects. I started with one, so here is a second to finish:

Toral Spirograph

Acknowledgements: Inspiration and most of the best ideas on spirographs come from conversations with Richard Grimes. The 3d renderings are made using Blender and LuxRender. Thanks to Ian Hopkinson (@SmallCasserole) for introducing me to this.


Surfaces in 3 and 4 dimensions

August 18, 2009

I hope the title is not too confusing, given my previous posts on surfaces. The title of this post is also the title of a work of mine that I have mentioned here a couple of times before. It has just gone up in the common room of the Maths Department of Imperial College. If you are a London mathematician take a look and let me know what you think!

Here is the work in place. The order was chosen by Anne Rowlands and Andy Pope. I love seeing how they chose to interpret my work!

Picture 173

Picture 174


Unscheduled Post: Hyperbolic Polydron

April 13, 2009

What happens when you put seven equilateral triangles round a point?  

Inspired by sumidiot who was himself inspired by division by zero who were making paper hyperbolic soccer balls, I thought I would put up some pictures of a similar project with polydron.  The construction is simple.  Attach seven triangles round a vertex this gives 7 outside vertices.  Add triangles so these all have exactly seven around them and repeat.  The surface flexes in most interesting ways.

Interestingly it is still an open question whether, assuming zero thickness and perfect hinges, this construction can be continued for ever, embedding a model of the hyperbolic plane in 3 dimensions.  If you take eight triangles round a vertex I believe it is possible as you can regularly fold things up and down.

David Richter has some more thoughts and discussion.

library-2171
library-2183library-2208library-2215


Surfaces 2: Algebraic Surfaces

March 29, 2009

There is a boring intro, pictures below…OK, here’s a taster…

cayley

Consider the history of numbers, it starts, of course, with the whole numbers, starting from one.  The numbers we use to count things, to a mathematician the Natural Numbers.  Subtraction however is a very useful operation but it has a problem 5-7 seems like a reasonable thing to do, but the answer is not a natural number.  After a surprisingly long time people accepted that it was worth including negative numbers and zero.  This gives a system in which we can add and subtract freely without coming across new numbers, we can say that this new system the Integers is closed under addition and subtraction.

God gave us the integers; the rest is the work of Man.
Leopold Kronecker

The next step is to use multiplication.  The integers are closed under multiplication.  However consider the following equation: 3*x = 6.  In this case we can see that the only possible value for x is 2, as 3*2 = 6.  To calculate this we need an additional operation: division, so we have 2 = 6/3.  Once again we are faced with a problem.  Division needs new numbers, as the only solution of 5*x = 6 is 6/5.  The solution is simply to include these numbers in our system.  We now have the collection of all fractions.  The Rational numbers.  

Continuing this process we can now consider a sequence of multiplications and additions together and ask for solutions.  For example taking a number, multiplying it by itself, and then asking when this is equal to the original number plus one.  This gives a polynomial: x^2 = x + 1 , which is the same as x^2 - x - 1 = 0 .  By convention polynomials are written with 0 on one side of the equation.  Finding solutions to such equations has a long history in early mathematics, and the general case was only understood in the nineteenth century, involving Complex numbers and the elegant insights of Galois.  

What happens when we allow more than one unknown in the equation? The answer is that instead of getting a small number of points in many cases we get a line.  For example consider the equation x^2+y^2-1 = 0.  The points (x,y) that satisfy this equation are the points on a circle of radius 1.  By changing the -1 we get circles of different radii. When this value is 0we no longer have a line the only possible point is (0,0), that is the circle of radius 0, as both x^2 and y^2 must have positive values.  Similarly if this value is positive there are no solutions with real numbers (I will avoid complex numbers for this post).  

A different way of looking at this is to consider the function f(x,y) = x^2 + y^2 this attaches a value to every point on the plane.  We then want to consider the set of points with a particular value.  In the first example this is 1.  

Lets now go to three unknowns.  We now start to get very interesting as the sets of solutions move from lines to surfaces.  As a first example we can try the generalisation of the equation for the circle above to three variables x^2 + y^2 +z^2 = 1.  Perhaps unsurprisingly we get a sphere:

sphere

x^2+y^2+z^2-1

So what else can we get from these equations.  In fact a very wide collection of things, and I encourage you to play around using some of the software available to draw arbitrary equations.  For the images in this post I used surfex, a front end for surf, but this is a little bit of a meal to set up, also it does not produce three dimensional models.   There are easier options on the web,  the Liverpool surface modelling package can be used to generate models online and it has an online front endend to play with.

So have you been away to play?  That is a far easier way to gain intuition than trying to decypher my cryptic comments.  However a some point one moves from being willing to simply try random equations to wanting to put some control on the process.  So here is some guidance as to how you might do that.  Yes, this is part of the plot to generate unlimited numbers of maths based logos, that I mentioned in the last post.

To design I will work with the idea of genus introduced in the last post.  This is the number of holes through the surface.  The definite cheat of google can home straight in on equations for the Torus/donut with genus one.

torus

(x^2+y^2+z^2+.5)^2 - 4(x^2+y^2)

We will therefore start by trying genus two.  As two dimensions are easier to work with, what can we do on the plane.  A little playing comes up with x^2 - y^2 - x^4 = 0 that gives a figure of eight.  For consistency I will draw this in three dimensions.  If we do not include z in the polynomial then this direction does not change where the zeroes lie so we get a cylinder with cross section given by the curve in two dimensions.  

figure_of_8

x^4 -x^2 +y^2

So how can we use this curve to give a surface?  We have to make it change with z, and when we cut through for some value of z we will see two curves.  Lets get two curves close to this one therefore.  To do this we can first square the function (x^4 -x^2 +y^2)^2 this does not change the set of zeroes, but when we consider the function on all space it makes all values positive.  If we look at the points which have a small value therefore we will get two curves close to the figure of eight:

curves_round_8

(x^4 -x^2 +y^2)^2 - 0.1

Now we need to get the small value to change with z being negative in a small range, zero at two points, so the surface closes up and positive elsewhere.  If the value is positive then there are clearly no zeroes, as (x^4 -x^2 +y^2)^2 is always positive itself.  We have already seen how to get this, using z^2.  Adjusting numbers a little to improve the image gets the desired surface with two holes:

genus2

(x^2-y^2-x^4+0.159)^2+(z^2-0.043)

One technique that we used here was to square the function so that every point in space was given a number greater than or equal to zero.  This suggests a second method to make holes.  If we take a function that only gives positive values and add a second function, then the surface of zeroes for the sum must lie in the negative region of the second function.  In other words it cannot cross the zeroes for the second function.  Furthermore, as 0 + 0 = 0 the new surface will touch the surface for the second function on a curve in the zeroes of the first.  Its easier to see a picture.  Take the sphere as defined above x^2 +y^2 +z^2 - 1 = 0, square the function to get (x^2 +y^2 +z^2 - 1) ^2= 0 and now add a second function, x perhaps, giving (x^2 +y^2 +z^2 - 1)^2 + x = 0.  This can be zero only if x is positive, so we have:

(x^2+y^2+z^2-1)^2+x

(x^2+y^2+z^2-1)^2+x

The sphere now bows back in touching but not going through the plane x = 0.  We can do a lot with this trick to create holes.  For example, sticking with the sphere, let us use one of the functions from above to cut four holes in it:

punctures sphere

(x^2+y^2+z^2-2)^2+.01*(x^2-y^2-x^4-.01) given by x^2-y^2-x^4-.01 cutting through the sphere.

As a quiz, what is the genus of this surface?

A final more complicated example uses the function x^4 + y^4 + z^4 = 0, this defines a rounded off cube, that cuts through the sphere in an interesting way, to give an interesting surface:

cube_sphere

Clockwise from upper left: round cube x^4+y^4+z^4-1, round cube and sphere, sphere and (x^2+y^2+z^2-2)^2+.1(x^4+y^4+z^4-2), sphere cut away by round cube: (x^2+y^2+z^2-2)^2+.1(x^4+y^4+z^4-2)

To finish the surface I began with, this is a Cayley surface, with four singularities (the places the surface comes to a point).  Up to some non-trivial transforms of surfaces this is the unique cubic surface with this property, a cubic surface is a surface where  no more than three of x, y and z are multiplied together, so x^3 and xyz are possible but x^4 or $x^2y^2$ are not.  This surface is the same as the model I showed in my previous post.

cayley

5(x^2y+x^2z+y^2x+y^2z+z^2y+z^2x)-2(xy+xz+yz)