What is…Spherical Geometry?

This week, we’ll look at another type of geometry, namely spherical geometry.  Quite simply, this is the geometry of a sphere.  Here, a sphere is a set of points equidistant from a given center.  In other words, throughout this post, you should imagine only a surface, with nothing inside it — think of the rind of an orange, without any of the slices.  I began to describe spherical geometry in my original post, What is a Geometry?, so I’ll briefly summarize the ideas in that post first.  It wouldn’t hurt to review it…

From a Euclidean standpoint, there are points on the sphere, but obviously no straight lines.  In spherical geometry, we define a Point to be a pair of antipodal points on the sphere, and a Line to be a great circle on the sphere.  This results in two nice theorems of spherical geometry:  any two distinct Lines determine (intersect in) a single Point, and any two distinct points determine a single Line.

This is a departure from Euclidean geometry, for this means that there are no parallel Lines in spherical geometry, since distinct Lines always intersect.  But there is something more going on here.

Consider the statement “Any two distinct Lines determine a single Point.”  Now perform the following simple replacement:  change the occurrence of “Line” to “Point,” and vice versa.  This gives the statement “Any two distinct Points determine a single Line,”  and is called the dual of the original statement.

Thus, we have the situation that some statement and its dual are both true.  Now if this is true of some set of statements in spherical geometry — that the dual of each statement is true — and we derive a new result from this set of statements, then the following remarkable thing happens.  Since the dual of any statement we used is true, then the dual of the new result must also be true!  Just replace each statement used to derive the new result with its dual, and you get the dual of the new result as a true statement as well.

This is the principle of duality in mathematics, and is a very important concept.  We will encounter it again when we investigate projective geometry.

Triangles and trigonometry are different on the sphere, as well.  A spherical triangle is composed of three arcs of great circles, as in the image below.


If this were Earth, you could imagine starting at the North Pole, following 0 degrees of longitude to the Equator (shown in yellow), follow the Equator to 30 degrees east longitude, then follow this line of longitude back to the North Pole.

On the sphere, though, sides of a triangle are actually angles.  Sure, you could measure the length of the arcs given the radius of the sphere, but that’s not as useful.  Consider the choice of units on the Earth — kilometers or miles?  We don’t want important  geometrical results to depend on the choice of units.  So a side is specified by the angle subtended by the arc at the center of the sphere.  This makes sense since the sides are arcs of great circles, and the center of any great circle is the center of the sphere.

The angles between the sides are angles, too!  A great circle is just the intersection of a plane passing through the origin and the sphere.  So the angle between any two sides is defined to be the angle between the planes which contain them.

Really nothing from Euclidean trigonometry is valid on the sphere.  For example, if you look at the triangle above, you can see that the angles between the sides are 30, 90, and 90 degrees.  These angles add to 210!  In fact, the three angles of a triangle always add up to more than 180 degrees on a sphere.  (You may notice that the sides of this triangle are also 30, 90, and 90 degrees, but this is just a coincidence.  The sides and angles are usually different.)

If A, B, and C are the angles of a spherical triangle, it turns out that the area of the triangle is proportional to ABC – 180.  This means that the smaller a triangle is, the closer the angle sum is to 180 degrees.


There is no Pythagorean Theorem on the sphere, either.  In addition, if a, b, and c are the sides opposite angles A, B, and C, respectively, then we have formulas like

\cos c=\cos a\cos b+\sin a\sin b\cos C


\cos C=-\cos A\cos B+\sin A\sin B\cos c.

One interesting consequence of the second of these formulas is this.  If you know the angles of a triangle, you can determine the sides.  You can’t do this in Euclidean trigonometry, since the triangles may be similar, but of different sizes.  In other words, there are no similar triangles on the sphere.  Spherical triangles are just congruent, or not. You can’t have two different triangles with the same angles.

For now, we’ve considered our sphere as being embedded in a Euclidean space.  The definition of this surface is easy:  just choose a point as the center of your sphere, and then find all points which are a given, fixed distance — the radius of the sphere — from that point.  Sounds easy enough.

But can you imagine a sphere without thinking of the three-dimensional space around it?  Or put another way, imagine you were a tiny ant, on a sphere of radius 1,000,000 km.  That’s over 150 times the radius of the Earth!  How would you know you were actually on the surface of a sphere?  If you were that small and the sphere were that large, it would seem awfully flat to you….

So how could you determine the sphere was curved?  This is a question for differential geometry, which among other things, is about the geometry of a surface without any reference to a space it’s embedded in.  This is called the surface’s intrinsic geometry.

As an example of looking at the intrinsic geometry of the sphere, consider Lines.  Now you can’t say they’re great circles any more, since this relies on thinking of a sphere as being embedded in three-dimensional space; in other words, its extrinsic geometry.  You need the concept of a geodesic — in other words, the idea of a “shortest path.”

So if you’re the ant crawling between two points on a sphere, and you wanted to take the shortest path, you would have to follow a great circle arc.  So it is possible to define Lines only using properties of the surface itself.  But the mathematics to do this is really extremely challenging.

Lots of new ideas here — but we’ve just scratched the surface of a study of spherical geometry.  You can see how very different spherical geometry is from both Euclidean and taxicab geometry.  Hopefully you’re well on your way to wrapping your head around our original question, What is a Geometry?….

A New Cantor Set?

Although we’ll do a little review, this post assumes some familiarity with the Cantor set as well as working with fractions in bases other than 10.

So what is the Cantor set?


The usual geometrical definition is to begin with a line segment of length one (as shown at the top of the figure).  Next, remove the middle third of that segment, so that two segments of length 1/3 are formed.  Then remove the middle thirds from those segments, and continue recursively.

Even though — after this process is repeated infinitely, of course — you remove segments whose lengths sum to 1, there are still infinitely many points left!  (Actually, uncountably infinitely many, although this observation is not necessary for our discussion.)

There are many ways to describe the remaining points, but one common way is to say that the Cantor set consists of all those numbers between 0 and 1 (inclusive) which, when written in base 3, may be written only with 0’s and 2’s.

Again, we’ll briefly review.  We have .23 = 2/310, for example — since the places after the ternary point (no “deci”mals here) represent powers of 1/3.

So if we wanted to find 3/4 in base 3, we note that we’d need 2/3 = 0.23, but there would be 1/12 left over. This is smaller than 1/9, so we’re at 0.203 so far. Next, we need 2/27, giving 0.2023, with 1/108 left over. And so on. The result is that 3/4 is equal to 0.202020…3, where the “20” repeats. This can also be shown using infinite geometric series, if desired:


Surprisingly, the idea for a possibly new type of “Cantor set” came from studying binary trees!  I say possibly new, since I couldn’t find any reference to such a set online, but of course that doesn’t mean someone else hasn’t come across it.  And I call it a type of Cantor set since it may also be formed by taking out thirds of segments, but in a slightly different way than described above.


Now I’ve talked a bit about binary trees before, so I won’t go into great detail.  But here is the important idea:  when you make a branch, you’re pointing in some particular direction, and then turn either left or right, but you can’t just keep going in the same direction.

So what if you looked at ternary expansions, and as you added digits, you had the option of adding 1 to the previous digit (like turning left), or subtracting 1 (like turning right), but you couldn’t use the same digit twice consecutively.  So 0.21021201 would be OK (we’ll drop the 3 subscripts since we’ll be working exclusively in base 3 from now on), but 0.12002120 would not be allowed since there are consecutive 0’s.

Note that adding 1 to 2 gives 0 in base 3, and subtracting 1 from 0 gives 2.  So essentially, starting with 0., you build ternary expansions with the property that each digit is different from the previous one.  And, of course, the expansions must be infinite….

What do iterations of this scheme look like?


We start with a segment of length 1.  Recall we begin with 0., so that means the ternary expansions may begin with 0.1 or 0.2.  Expansions beginning with 0.0 are not allowed, so this precludes the first third of the segment.

Now here comes the interesting part!  On the second iteration, (the third line from the top), we remove different thirds from the first two segments.  Since the 0.1 may continued onto 0.10 or 0.12, but not 0.11, we remove the middle third from the 0.1 segment.  Further, 0.2 may be continued as 0.20 or 0.21, but not 0.22, so we remove the last third of the 0.2 segment.  The iteration process is not symmetrical.

We continue on….  Since 0.10 may be continued as 0.101 or 0.102, but not 0.100, we remove the first third of the 0.10 segment.  You get the idea.  Seven iterations of this procedure are shown in the figure above.

Note that since the process for creating the original Cantor set is symmetrical, this imposes a self-similarity on the set itself.  The Cantor set is exactly the union of two duplicate copies of the original, scaled by a factor of 1/3.

In other words, the Cantor set may also be created using an iterated function system with the following two transformations:

y=\dfrac13x,\qquad y=\dfrac13x+\dfrac23.

What about the self-similarity of the new Cantor set?  To help in seeing this, here’s a slightly more detailed version of the iteration scheme.


Is there any self-similarity here?  Yes, but the fewest number of transformations I’ve found to describe this self-similarity is five.  The curious reader is welcome to find fewer!

It isn’t hard to see the five vertical bands in this figure — the first three look the same (although the second one appears to be reflected), and the last two also look the same, although reflections of each other.

The first band is all ternary expansions in this new set beginning with 0.10.  How do these relate to the whole set?  Well, 1/9 of the set consists of expansions beginning with 0.001… or 0.002…, and then adding digits different from those previous.  Adding 1/3 therefore gives all expansions beginning with 0.101… or 0.102…, and then adding different digits.  This implies that the self-similarity describing the first vertical band is

y=\dfrac 19x+\dfrac13.

The second band consists of those expansions in our strings beginning with 0.12.  But if x is an expansion in our set beginning with 0.10, then 1 – x must be an expansion in our set beginning with 0.12, since we may write 1 as .22222…, repeating.  Therefore, the second band is represented by the transformation

y=1-\left(\dfrac 19x+\dfrac13\right)=\dfrac23-\dfrac19x.

We can think of the third band just as we did the first — except that this band consists of number beginning with 0.20 (rather than 0.10).  So this band is represented by the transformation

y=\dfrac 19x+\dfrac23.

The last two bands consist of those expansions beginning with 0.21.  Here, we break into the two cases 0.210 and 0.212, and use our previous work.  For example, those beginning with 0.210 can be found by taking those beginning with 0.10, dividing by 3 to get expansions beginning with 0.010, and then adding 2/3 to get expansions beginning with 0.210:

y=\dfrac13\left(\dfrac 19x+\dfrac13\right)+\dfrac23=\dfrac1{27}x+\dfrac79.

We describe the self-similarity of the last band — those expansions beginning with 0.212 — analogously:

y=\dfrac13\left(\dfrac23-\dfrac 19x\right)+\dfrac23=\dfrac89-\dfrac1{27}x.

These are five transformations which describe the self-similarity of the new Cantor set.  I haven’t rigorously proved yet that you can’t do it in fewer, but I think this is the case.

Of course this is just the beginning — you can use the same rule in any base.  That is, begin with 0., and either add or subtract one from the previous digit.  In base 4, you get nice self-similarity, but it gets more involved in higher bases.  In bases higher than 3, you can also use the rule that the next digit in the expansion is different than the previous — and this gives yet another class of Cantor sets.  I’ll leave you to investigate, and perhaps I’ll write again about these Cantor sets when I find out more!

What is…Taxicab Geometry?

It’s time to start exploring different geometries!  Today we’ll look at taxicab geometry because algebraically, it’s the easiest one to work with.  I discussed it briefly before — recall that lines and points are the same as those in the Euclidean geometry we’re used to, but the idea of distance is different.  Here, the distance between two points P and Q is how far a taxi would have to drive on a rectangular grid to get from P to Q.

You can see from the figure that the distance between (-2,3) and (3,-1) is 9, since you’d have to drive nine blocks to get from one point to the other.  This might seem simple enough, but the situation is quite a bit different from Euclidean geometry.


In Euclidean geometry, the shortest distance between two points is a straight line segment.  If you deviate from this segment in any way in getting from one point to the other, your path will get longer.

In taxicab geometry, there is usually no shortest path.  If you look at the figure below, you can see two other paths from (-2,3) to (3,-1) which have a length of 9.

Strange!  There are a few exceptions to this rule, however — when the segment between the points is parallel to one of the axes.  For example, the distance from (0,0) to (4,0) is just 4 — and there’s only one way to get there along a path of length 4.  You’ve got to travel along the line segment joining (0,0) and (4,0).

Well, perhaps “strange” is the wrong word.  All of this is perfectly normal in taxicab geometry….

Now let’s take a look at triangles.  We define them in the usual way — choose three points, and connect them in pairs to form three sides of a triangle.  Just like in Euclidean geometry.

Because we’re so familiar with them, I’ve drawn what would be — if we were in the Euclidean realm! — two 3-4-5 right triangles.  You’re welcome to verify that OP’Q’ would indeed be a 3-4-5 triangle in Euclidean geometry.


OK, now let’s look at these triangles from the perspective of taxicab geometry.  While we can just study these triangles by looking at the graph, it might be helpful to formally define the taxicab distance function.  If two points have coordinates P=(x_1,y_1) and Q=(x_2,y_2), the distance between them is defined to be


First, a word about saying that we’re defining the distance.  That’s right — a different distance, like the one we’re used which comes from the Pythagorean theorem, would produce a different geometry.  So how your geometry “works” depends upon how you define the distance.

Second, a word about the formula.  Take a moment to convince yourself that |x_2-x_1| is how far your taxicab would have to drive in an east-west direction, and |y_2-y_1| is how far your taxicab would have to drive in a north-south direction.  Absolute values are needed:  the distances d_T(P,Q) and d_T(Q,P) should be positive and equal to each other.

Back to the triangles.  In a taxicab world, OPQ is a 3-4-7 triangle!  That might strike you as a bit unusual, since in the Euclidean world, the sum of the lengths of any two sides of a triangle is always greater than the length of the third.  This is called the triangle inequality, and is usually written

d_E(X,Z)\le d_E(X,Y)+d_E(Y,Z)

for points XY, and Z, where we write d_E to mean the Euclidean distance.  In Euclidean geometry, the only way this inequality can actually be an equality is if Y is on the line segment whose endpoints are X and Z — and no other way.  But as we’ve just seen,

d_T(O,Q)= d_T(O,P)+d_T(P,Q),

where P is evidently not on the segment joining O and Q.  Yet another difference between taxicab and Euclidean geometries.

Oh, but it gets better….  In the figure above — at least in a Euclidean world — when you rotate two triangles, the angles and lengths remain the same.  In other words, the triangles are congruent.  It may seem obvious, since clearly the two triangles look the same.

What happens when we “rotate” triangle OPQ in a taxicab world?  I put “rotate” in quotes since we haven’t looked at whether or not the Euclidean idea of “angle” has a companion in the taxicab world.

If you do the calculations, you’ll see that OP’Q’ is in fact a 21/5 – 5 – 28/5 triangle!  Moreover, even though OQ was the longest side of triangle OPQ, OQ’ is not the longest side of triangle OP’Q’!  The longest side is actually OP’.

What’s going on here?  We are so used to being able to draw a triangle on a piece of paper — and certainly, if we turn our piece of paper, the lengths of the sides of the triangle don’t change!  The triangle stays exactly the same — this is the notion of congruence.  But when you change the distance function to d_T, the geometry changes.  In a very fundamental way, as you see.

Essentially, we need to give up the idea of “angle” in taxicab geometry.  That might sound odd — how can you have geometry without angles?  As it turns out, there are lots of ways to do this.  We’ll be looking at this idea more as this thread continues.

And although there are differences, there are certainly things in common — such as the fact that there is a triangle inequality in both geometries.  Is this just coincidence?  Mathematically, a distance function is one which satisfies, for points X, Y, and Z:

1.  d(X,Y) \ge 0, {\rm \ with\ equality\ only\ when\ } X=Y,

2.  d(X,Y)=d(Y,X), {\rm\ and}

3.  d(X,Z)\le d(X,Y)+d(Y,Z).

Now we’ve already encountered properties 2 and 3 so far, and property 1 simply says that two differents points have to be separated by some positive distance.

The concept of a distance function evolved over time — whenever it made sense to talk about distance, it seemed these properties were always in play.  And in fact, the distance functions in both Euclidean and taxicab geometry have these three propertes.

So different distance functions produce different geometries.  Perhaps the hardest thing about encountering new geometries is putting aside ideas from Euclidean geometry — “forgetting” all about angles, for example, while we’re in a taxicab world.  Hopefully, as you learn about more and more non-Euclidean geometries, it will become easier and easier to navigate this Universe of diverse geometrical worlds….


Imagifractalous! 3: Fractal binary trees

I’ve taken a break from Koch-like curves and p-adic sequences for an arboreal interlude….  Yes, there’s a story about why — I needed to work with Nick on a paper he was writing for Bridges — but that story isn’t quite finished yet.  When it is, I’ll tell it.  But for now, I thought I’d share some of the fascinating images we created along the way.


Let’s start with a few examples of simple binary trees.  If you want to see more, just do a quick online search — there are lots of fractal trees out there on the web!  The construction is pretty straightforward.  Start by drawing a vertical trunk of length 1.  Then, move left and right some specified angle, and draw a branch of some length r < 1.  Recursively repeat from where you left off, always adding two more smaller branches at the tip of each branch you’ve already drawn.

If you look at these two examples for a moment, you’ll get the idea.  Here, the angle used is 40 degrees, and the ratio is 5/8.  On the left, there are 5 iterations of the recursive drawing, and there are 6 iterations on the right.

Here’s another example with a lot more interaction among the branches.


This type of fractal binary tree has been studied quite a bit.  There is a well-known paper by Mandelbrot and Frame which discusses these trees, but it’s not available without paying for it.  So here is a paper by Pons which addresses the same issues, but is available online.  It’s an interesting read, but be forewarned that there’s a lot of mathematics in it!


In trying to understand various properties of these fractal trees, it’s natural to write code which creates them.  But here’s the interesting thing about writing programs like that — once they’re written, you can input anything you like!  Who says that r has to be less than 1?  The tree above is a nice example of a fractal tree with r = 1.  All the branches are of the same length, and there is a lot of overlap.  This helps create an interesting texture.

But here’s the catch.  The more iterations you go, the bigger the tree gets.  In a mathematical sense, the iterations are said to be unbounded.  But when Mathematica outputs a graphic, it is automatically scaled to fit your viewing window.  So in practice, you don’t really care how large the tree gets, since it will automatically be scaled down so the entire tree is visible.

It is important to note that when r < 1, the trees are bounded, so they are easier to study mathematically.  The paper Nick and I are working on scales unbounded trees so they are more accessible, but as I said, I’ll talk more about this in a later post.


Here are a few examples with r > 1.  Notice that as there are more and more iterations, the branches keep getting larger.  This creates a very different type of binary tree, and again, a tree which keeps getting bigger (and unbounded) as the number of iterations increases.  But as mentioned earlier, Mathematica will automatically scale an image, so these trees are easy to generate and look at.

Nick created the following image using copies of binary trees with r approximately equal to 1.04.  The ever-expanding branches allow for the creation of interesting textures you really can’t achieve when r < 1.


Another of my favorites is the following tree, created with r = 1.  The angle used, though, is 90.9 degrees.  Making the angle just slightly larger than a right angle creates an interesting visual effect.


But the exploration didn’t stop with just varying r so it could take on values 1 or greater.  I started thinking about other ways to alter the parameters used to create fractal binary trees.

For example, why does r have to stay the same at each iteration?  Well, it doesn’t!  The following image was created using values of r which alternate between iterations.


And the values of r can vary in other ways from iteration to iteration.  There is a lot more to investigate, such as generating a binary tree from any sequence of r values.  But studying these mathematically may be somewhat more difficult….

Now in a typical binary tree, the angle you branch to the left is the same as the angle you branch to the right.  Of course these two angles don’t have to be the same.  What happens if the branching angle to the left is different from the branching angle to the right?  Below is one possibility.


And for another possibility?  What if you choose two different angles, but have the computer randomly decide which is used to branch left/right at each iteration?  What then?


Here is one example, where the branching angles are 45 and 90 degrees, but which is left or right is chosen randomly (with equal probability) at each iteration.  Gives the fractal tree a funky feel….

You might have noticed that none of these images are in color.  One very practial reason is that for writing Bridges papers, you need to make sure your images look OK printed in black-and-white, since the book of conference papers is not printed in color.

But there’s another reason I didn’t include color images in this post.  Yes, I’ve got plenty…and I will share them with you later.  What I want to communicate is the amazing variety of textures available by using a simple algorithm to create binary trees.  Nick and I never imagined there would be such a fantastic range of images we could create.  But there are.  You’ve just seen them.

Once the Bridges paper is submitted, accepted (hopefully!), and revised, I’ll continue the story of our arboreal adventure.  There is a lot more to share, and it will certainly be worth the wait!

What is a Geometry?

This might sound like an odd question — most students seem to think so when I ask it.

The reason it sounds a little strange is that most students — even when I taught at a magnet STEM high school — think there’s just one type of geometry:  Euclidean geometry.  This isn’t surprising given the typical K-12 mathematics curriculum, and it’s not necessarily problematic, either.  But by the time students graduate from high school, they really should be aware that Euclidean geometry is just one among many different possible geometries.

Why should students be aware of other geometries?  Most will never need to use any geometry other than Euclidean in their day-to-day lives.  In my opinion, one compelling reason is that  you can get at a really big idea (the concept of a geometry) with very little effort, really.

Let’s look at a simple example for a moment:  spherical geometry.  Let’s define Point and Line in this geometrical framework, where I use capital letters to distinguish from the ideas of points and lines in our usual Euclidean geometry.

Imagine confining our attention to the surface of a sphere, and say that a “Point” is a pair of opposite points on a sphere (like the North pole and South pole), and that a “Line” is a great circle on the sphere, like the Equator or a line of longitude.  (Note how we use the term “line of longitude,” even though this line is in fact a circle!)

With these definitions, we offer our first Thereom of spherical geometry:  Any two Lines intersect in exactly one Point.  Now if you’ve got a globe in your room, this is easy to demonstrate.  Any two Lines of longitude intersect in one Point (consisting of the North and South poles), and it is also easy to see that the Equator intersects any Line of longitude in exactly one Point.

But, you might object, you just defined Points and Lines in some arbitrary way!  How can you just do that?  The simple answer is that this is precisely how you define a geometry.  The concepts of “point” and “line” depend on the geometrical context.  And since we’re looking at the surface of a sphere, a “line” just can’t mean the same thing as it does in Euclidean geometry.

OK, you might respond, but what about your definition of “Point”?  Surely that’s a bit off!  How can a “Point” be two “points”?  And why are your Lines only great circles?  What about other circles on a sphere, like lines of latitude?  Why don’t you include these as well?

This is a valid objection, and there is nothing preventing it.  But when you try to actually study the geometry defined in this way, it’s hard to make progress.  For example, two lines defined in this way could intersect in 0, 1, or 2 points.  And given any two points, there would be infinitely many lines passing through these points.

But with the definition of Point and Line as given earlier, we have two very nice results:  Any two Lines intersect in exactly one Point, and there is exactly one Line passing through any two distinct Points.  No ambiguity here — 0, 1, 2, or infinity.  All we need is 1.

So while in a technical sense, you can define basic ideas like “Point” and “Line” any way you like, in a practical, mathematical sense, your definitions should be useful.

Yes, useful.  We usually don’t think of definitions in this way, but mathematically, it really is necessary.  With your definitions and axioms, you want to prove interesting theorems.  If your definition of lines allows two distinct lines to intersect in any number of points, well, you haven’t really said very much.  Your definitions don’t get you anywhwere.

So what makes a definition useful?  Though perhaps stating the obvious, a definition is useful if other people actually use it.  Do other mathematicians think your construct allows for interesting results?  Can it be applied in other ways as an aid to learning about other areas of mathematics?  Are others interested enough in your mathematical system that they want to see what results they can come up with?

In a real sense, anyone can write down a few definitions and maybe state a simple theorem or two.  But you’ve got to convince others to care about what you’ve created.

So what has this got to do with Points and Lines?  These definitions are just the beginning of spherical geometry, which leads to spherical trigonometry and other areas as well.

And why do we care?  Among applications in studying spherical triangles and polyhedra, we think of spherical geometry when we ask a practical question such as, “What is the shortest flight path between two cities?”  It turns out the that shortest flight path is along a Line on the sphere, just as the shortest distance between two points is along a line in the Euclidean plane.

If you’ve been paying attention, you will also have noticed one important consequence of the theorem that any two Lines intersect in exactly one Point:  there are no parallel Lines on a sphere.  Simply put, any two lines intersect.

This means that spherical geometry is in some fundamental way different from Euclidean geometry, where it is possible for two lines to avoid intersecting.  In other words, we’ve created an entire world of Points and Lines distinct from the one we are familiar with, together with many interesting properties — some of which are just like those in the Euclidean world, while others are quite different.  We’ve created a new geometry.

What I’ll be doing in the posts in this series is gradually introducing you to different non-Euclidean geometries.  In this way, I hope you’ll develop an intuition for what a geometry is.  How concepts like point, line, angle, and circle seem fairly natural in various contexts, even though they may not be exactly like what you’re familiar with in Euclidean geometry.  But why, nonetheless, we still call these systems geometries.

Now the question has been thoroughly asked:  What is a geometry?   Hopefully, by the end of the series, you’ll be able to formulate your own answer to this new question — one you may never have asked yourself before.  But one question that is well worth answering.





The Ravioli Equation

I was in The Hill in St. Louis recently — that’s the really amazing Italian neighborhood in the city.  Had lunch there twice, actually, and it brought back memories of my trip to Florence.


I then remembered that I started working on a post a while back, but never quite finished.  An equation for ravioli.  Here it is:

\left(r-\dfrac1{(\cos^6\theta+\sin^6\theta)^{1/6}}-0.03 \arccos(\cos(24\theta))\right)\times

\hbox{ } \qquad\qquad\qquad\qquad\left(r-\dfrac{0.7}{(\cos^6\theta+\sin^6\theta)^{1/6}}\right)=0.

Looks a little complicated, but here is what you get when you graph it:


Yep, ravioli!  So I thought I’d talk about how I came up with The Ravioli Equation.  Not very deep, but there are a few interesting mathematical tidbits hiding in it.

Let’s look at the central mound — the curve which outlines all the deliciously stuffed goodness in the ravioli.  I note that the ravioli in the picture above has a sauce of nuts and sage in butter, but I don’t capture that in the equation….

This is an example of a superellipse, which is a generalization of the ellipse.  It has equation

\left|\dfrac xa\right|^n+\left|\dfrac yb\right|^n=1,

where a and b are positive numbers.  Of course when n=2, you get an ordinary ellipse, but for different n, you get other curves.

The parameters a and b are called semi-diameters of the superellipse, much like the semi-axes of an ellipse.  Because ravioli are basically square, I set a=b, so that the superellipse equation looks like


Below are a few examples with a = 1 and n being 1/2, 2, and 4 (from left to right).


So you can see that the larger n gets, the more the superellipse looks like a square.  I thought that a value of n = 6 looked just about right for ravioli.

Ravioli with pesto.

Because I wanted the outer edge of the ravioli to have a radius of approximately 1, I used a value of a = 0.7 for the inner mound.

I should say a few words about using polar coordinates.  Since superellipses are easily described with Cartesian coordinates, why bother to convert to polar?  Well, I needed to get the scalloped ravioli edge.  To show a simple example, consider a plot of the polar function

r=1+0.1\cos(12 \theta),\qquad 0\le\theta<2\pi.

Here’s what it looks like:


Notice how adding the additional cosine term to r makes the circle “oscillate” as \theta moves around the circle.  Also notice how the coefficient of \theta tells you how many scallops there are around the edge.

This is a fairly simple way to produce something that looks like the edges of ravioli, so I decided to use polar coordinates for everything.  Of course you remember the conversion, based on the definition of sine and cosine:

x=r\cos\theta,\quad y=r\sin\theta.

Substituting into the superellipse equation gives


and solving for r results in


And of course when n is even, the absolute value signs aren’t necessary.  So this gives the equation for the inner mound as


Now let’s move on to the outer, scalloped edge of the ravioli.  Let’s first look at the following polar function, which is basically a superellipse with some scalloping:


It looks like this (graphed together with the inner mound):


You can see the way the scalloping is modified when using a superellipse rather than a circle.  But in my mind, ravioli edges are a bit more “crinkly” than this.  The outer edges of the ravioli were just too smooth.

But there’s a nice fix.  It comes from the fact that the arccos (I prefer this notation for the inverse cosine function, since an exponent of -1 can be ambiguous) function is really not an inverse of the cosine function, since the graph of the cosine function fails the horizontal line test.  So we consider the domain of the arccos function to be [-1,1] and the range to be [0,\pi].  In this case, the graph

y=\arccos(\cos x)

looks like the line y=x on the interval [0,\pi]. But on the interval [0,4\pi], the function y=\arccos(\cos x) looks like


Now it should be clear that this function must be periodic with period 2\pi.  But what is happening on the interval [\pi,2\pi]?  In this case, x is in quadrants III and IV.  Since the range of \arccos x is [0,\pi], we’ve got to flip x over the x-axis — in other words,

\arccos(\cos x)=2\pi-x.

You can see that this is the correct equation for the graph on the interval [\pi,2\pi].  Add in the periodicity, and there you have it!

Using this new function adds the crinkliness to the ravioli edge.  Delicious!

And for the final equation, we note that if we would like to simultaneously graph r=f_1(\theta) and r=f_2(\theta), we simply graph the equation


So there it is — The Ravioli Equation!  Of course you can change the parameters around to suit your particular taste in pasta.  And you can even fiddle with how the corners of your ravioli look.  Using sine rather than cosine, the equation

\left(r-\dfrac1{(\cos^6\theta+\sin^6\theta)^{1/6}}-0.03 \arcsin(\sin(24\theta))\right)\times

\hbox{ } \qquad\qquad\qquad\qquad\left(r-\dfrac{0.7}{(\cos^6\theta+\sin^6\theta)^{1/6}}\right)=0

produces the ravioli below.


Does it look tastier than the cosine version?  Hard to decide….

I hope you’ve enjoyed this introduction to the art of mathematical pasta making!  It’s a fun activity, and definitely stimulates the appetite….  If you need some practice, here’s another fabulous dish of ravioli I had in Florence.  Make it!  Mathematically, of course…


Buon appetito!

Imagifractalous! 2: p-adic sequences

In Imagifractalous! 1, I talked about varying parameters in the usual algorithm for creating the Koch curve to produce a variety of images, and casually mentioned p-adic valuations.  What happened was about a year after I began exploring these interesting images, I did a Google search (as one periodically does when researching new and exciting topics), and stumbled upon the paper Arithmetic Self-Similarity of Infinite Sequences.

It was there that I recognized the sequence of 0’s and 1’s I’d been using all along, and this sequence was called a 2-adic valuation (mod 2).

Here’s the definition:  the p-adic valuation is the sequence such that the nth term in the sequence is the highest power of p which divides n. So the 2-adic valuation begins

0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, ….

Of course all terms with odd n are 0, and for the even n, you just look at the highest power of 2 dividing that even number.  And you can take this sequence (mod 2), or mod anything you like.

I naturally did what any right-thinking mathematician would do — looked up p-adic sequences in the The On-Line Encyclopedia of Integer Sequences.  Now it’s not that p-adic valuations are all that obscure, it’s just I had never encountered them before.

Of course there it was:  A096268.  And if you read through the comments, you’ll see one which states that this sequence can be used to determine the angle you need to turn to create the Koch snowflake.

I wasn’t particularly discouraged — this sort of thing happens all the time when exploring new mathematical ideas.  You just get used to it.  But something unexpected happened.

Image based on a 7-adic valuation.

I starting experimenting with other p-adic valuations mod 2 (since I had two choices of angles), and found similar interesting behavior.  Not only that, p didn’t have to be prime — any integer would do.

But most papers about p-adic valuations assumed p was prime.  Why is that?  If \nu_p is a p-adic valuation and p is prime, it’s not hard to show that


an often-used property in developing a theory of p-adic valuations.  But it only takes a moment to see that

\nu_6(4)=0,\quad \nu_6(9)=0,\quad \nu_6(4\cdot9)\ne\nu_6(4)+\nu_6(9).

Bad news for the p-adic theorists, but the fractal images couldn’t seem to care whether p was prime or not….

Beginning segment of a curve based on a 12-adic valuation.

So I didn’t plunge into researching p-adic valuations, since I needed a treatment which included p composite, which didn’t seem to be out there.

But here’s the neat part.  Most of the work I’d done to prove something already known — that a 2-adic valuation (mod 2) could be used to produce a Koch curve — could be used to study generic p.  So I was able to make fairly good progress in a relatively short amount of time, since I’d already thought about it a lot before.  I suspect it would have taken me quite a bit longer if I’d just casually read about the 2-adic result rather than prove it myself.

The progress made was similar to that of the 2-adic case — number of segments in each arm in the symmetric case, how many solutions given a particular order of symmetry, and so forth.

Now my fractal brain was truly revved up!  I enjoyed creating images using various p-adic valuations — the variety seemed another dimension of endless.  So I started brainstorming about ways to even further diversify my repertoire of fractal images.

The first two weeks of November were particularly fruitful.  Two ideas seemed to coalesce.  The first revolved around an old unexplored question:  what happened when you didn’t only change the angles in the algorithm to produce the Koch snowflake, but you also changed the lengths?

Of course this seemed to make the parameter space impossibly large, but I was in an adventurous mood, and the only thing at stake was a few moments with Mathematica generating uninteresting images.

Image based on a 3-adic valuation with different edge lengths.


But what I found was that if an image closed up with a particular symmetry, then as long as the sequence of edge lengths was appropriately periodic, the image with different edge lengths also closed up with the same order of symmetry!

This was truly mind-boggling at first.  But after looking at lots of images and diving into the algorithm, it’s not all that improbable.  You can observe that in the image above, segments of the same length occur in six different orientations which are 60 degrees apart, and so will ultimately “cancel out” in any final vector sum and take you right back to the origin.

Now I don’t have the precise characterization of “appropriately periodic” as yet, but I know it’s out there.  Just a matter of time.

The second big idea at the beginning of November involved skimming through the paper on arithmetic self-similarity mentioned above.  Some results discussed adding one sequence to another, and so I wondered:  what if you added two p-adic sequences before taking their sum (mod 2)?

Imaged based on adding 8-adic and 64-adic valuations with different edge lengths.

Well, preliminary results were promising only when the p-adic valuations involved were of the same power of some p, like in the image above (which also involves different edge lengths).

These ideas are only in a very preliminary stage — it’s the perennial problem of, well, waiting…..  It may look liking adding 2-adic and 3-adic valuations doesn’t get you anywhere, but maybe that’s just because you need so many more iterations to see what’s actually happening.  So there’s lots more to explore here.

Beginning segment of an image based on a 42-adic valuation.

So as the parameter space gets larger — mutliple different lengths, adding several different p-adic valuations — the variety becomes infinitely diverse, and the analysis becomes that much more involved.

But that makes it all the more intriguing.  And it will be all the more rewarding when I finally figure everything out….