# When is a Pi not a Pi?

In this level-0 post celebrating Pi Day, we are talking all about circles in weird spaces! In particular, when is the ratio of the circumference of a circle to its diameter not equal to 3.14159(etc)? Ceci n’est pas une pi, as they say.

###### Introduction

Every year on March 14th (3/14), people all over the world celebrate Pi Day, in appreciation of everyone’s favorite* circle constant. And what better way to celebrate than to talk about when $\pi\neq3.14159\ldots$? “But wait” I hear you say. “Pi is always just pi, it’s a numerical constant. How can a constant have multiple values?” Well, $\pi$ is determined by the ratio of a circle’s circumference to its diameter (among other possible definitions). In different contexts, what it means to be a circle and how one might measure diameter or circumference can deviate from the image that most of us have in our heads. This interesting idea is the motivation behind this post. But in order to probe this idea further, we will have to answer a couple of questions: what is a circle, and how do you measure distance?

Let’s start with the easy one: what is a circle? There are different ways of defining what a circle is, but the one we will use here is that a circle is the set of points which are all the same distance (the radius) from a central point. This definition has two main upsides: it is intuitive and it is generalizable. So long as we have a notion of what “distance” means, we can draw a circle anywhere. But that naturally leads to our other question: what does “distance” mean?

The way that we define the distance between two points is called a metric, basically a function that spits out a number when we feed it two points, with some rules on how it should behave. There are only 4 rules, so we’ll go over them briefly. First, the distance between any two points has to be positive or 0. Second, the only time the distance should be 0 is if you are measuring the distance between a point and itself. Third, the distance from point A to point B is the same as the distance from point B to point A. Finally, the metric has to satisfy what is called the triangle inequality. If you have 3 points A, B, and C, then the distance from A to B can never be bigger than the distance from A to C plus the distance from C to B. In other words, there are no shortcuts. If any of these rules seem obvious to you, that’s good. Axioms like these are designed to be “obvious truths” on which to build up more interesting truths.

The usual way we measure distances is called the Euclidean metric, which you might recognize from the Pythagorean theorem. The Euclidean distance between the points $A=(x_A,y_A)$ and $B=(x_B,y_B)$ is

$d(A,B) = \sqrt{(x_A-x_B)^2 + (y_A-y_B)^2}$,

which we will refer to a few times in the rest of this post.

Note: we will need to use $\pi=3.1415\ldots$ as a numerical constant in this post, so when we refer to the ratio of a circle’s circumference to its diameter, we will use the capitalized $\Pi$ instead.

###### Taxicab circles

You might think that the Euclidean metric is the One True Metric, since it is how we most often measure distances. However, there are other ways of measuring distances which could be more useful in certain situations. The most intuitive is probably the taxicab metric. Imagine driving a taxi on a grid of roads, which all go either North/South or East/West. If you wanted to know how far you had to drive from your home to the supermarket, you wouldn’t measure distance as the crow flies, but rather you would measure the distance along roads. Essentially, number of blocks you have to travel North/South plus the number of blocks you have to travel East/West. This way of measuring distance is called the Taxicab metric, or sometimes the Manhattan metric. If we call the coordinates of your home $(x_h, y_h)$ and those of the supermarket $(x_s, y_s)$, then the distance ($d$) can be calculated by

$d = |x_h - x_s| + |y_h - y_s|$.

With this new metric, we can now draw a circle in the taxicab metric. We can now build the taxicab circle by finding the points that are all the same distance from a single point. The result of this is drawn below.

Now we can check what the value of $\Pi$ is by finding the circumference of the unit circle. The circle is made of 4 straight lines, and we can find the length of these lines by using the taxicab metric. This is actually way easier than computing lengths with Euclidean metric. For example, the line segment on the upper right part of the circle has length 2 because to get from (1,0) to (0,1) you go 1 unit horizontally and 1 unit vertically. put those 1’s together and you get 2. With all 4 sides, you get a full circumference of 8. From our definition of $\Pi$, using a diameter of 2, we get $\Pi=4$.

###### Circles in $L_p$ metrics

The taxicab metric and the Euclidean metric are in fact part of a larger family of metrics called the $L_p$ metrics, with the taxicab metric being $L_1$ and the Euclidean metric being $L_2$. We can write the distance between points $(x_1,y_1)$ and $(x_2,y_2)$ in a general $L_p$ metric as

$d=\sqrt[p]{|x_1-x_2|^p+|y_1-y_2|^p}$,

where we take $p$ to be a positive number. There is actually a quite simple way of parameterizing the unit circle in an $L_p$ metric by recalling the fact that $\cos^2\alpha+\sin^2\alpha=1$, but that is left as an exercise for the curious reader. Below is an animation of the unit circle in an $L_p$ metric, for varying values of $p$.

In the animation, you can see that for $p=2$ you have a Euclidean circle, and for $p=1$, you have a taxicab circle. Interesting things are happening in between. Of course, the four points $(1,0)$, $(0,1)$, $(-1,0)$, and $(0,-1)$ are part of the circle for any value of $p$. Then as the value of $p$ oscillates between very small and large numbers, the circle seems to inflate and deflate. For very small $p$, the circle is almost indistinguishable from two lines forming a cross. At very large values of $p$, the circle starts to look like a square with side length 2 (and indeed as $p$ goes off to infinity, it gets closer and closer to that square). In order to compute $\Pi$ for these circles, we must use their respective metrics, which requires a bit of calculus, so we will settle in this post for a plot. Below is a plot of the values of $\Pi$ for each value of $p$.

What I love about this plot is that you can see that $\pi$ is actually the minimum possible value for $\Pi$ across all values of $p$. I have also labelled the taxicab result we got before, where $\Pi=4$. There are two interesting limits here. The first is when $p$ becomes very small. In this limit, the value of $\Pi$ blows up, tending towards infinity. The second is the limit as $p$ becomes very large. Here, the value of $\Pi$ is tending towards 4 again. This latter limit is easy to reason through. The circle becomes a square in this limit, and the sides (in this metric of course) can be measured as straight vertical and horizontal lines. In all $L_p$ metrics, vertical and horizontal lines have the same length, so we know that the circumference is then $2\times4=8$, and then dividing by the diameter gets you back down to 4.

As an aside, we could also see what happens in an $L_p$ metric when we change our definition a circle to the following: a circle is the collection of points which are all the same distance away from the central point, as measured by the Euclidean metric. With this definition, the visual shape of the circle is always the familiar round shape we are used to. However, the fact that our definition uses the Euclidean metric doesn’t mean that is the metric on our space. We could still measure the circumference, and thus $\Pi$, using an $L_p$ metric. For a range of values of $p$, the value of $\Pi$ looks like the following. I find it quite interesting that the taxicab metric still outputs $\Pi=4$ here.

You might be seeing this family of metrics, which contains our familiar Euclidean metric and wonder why the universe seems to have chosen $L_2$, as opposed to any of the others. It is an interesting question, and there are a few answers, but here is one that I like. The $L_p$ metrics all have the same symmetries, they can be rotated 90 degrees at a time or flipped over 4 different axes, the same 8 symmetries as a square. However, there is one metric which is different in that it has an infinite number of symmetries, and that is $L_2$, the Euclidean metric. The $x-$ and $y-$axes can be rotated by any angle or flipped over any line and still give the same $L_2$ distances. It is the only $L_p$ metric which does not have a preferred pair of directions. And this property is shared by the universe as we know it.

###### Circles on a sphere

So far, we have looked only at changing the metric, but there is another option: change the space itself. Instead of confining ourselves to a flat plane, we could imagine circles on curved spaces. For most people, the easiest curved space to think about is the sphere (we live on one after all). The nice thing about the sphere is that we can fairly easily measure distances on the sphere using the Euclidean metric (to be specific, the 3D Euclidean metric, confined to the surface of the sphere). For this reason, we will not even need to write down an explicit metric for the sphere, which is great because just to build up to the point where we could write down the metric would take quite a while.

So what does a circle on a sphere look like? Well, imagine standing on a sphere. If you start walking in a straight line in any direction, after a while you would return to where you started. This path is a great circle of the sphere, so called because it is the circle with the largest circumference you can fit on the sphere. But wasn’t that supposed to be a straight line? Yes! On a sphere, every straight line is also a circle! But there are more circles to be found. Below is an animation showing all of the circles that you could draw from a particular center point.

Now let’s start thinking about pi. We need the circumference and diameter of these circles. Notice that the circles on the sphere are also circles in the 3D space that the sphere is sitting in. That means we can take the circumference of these circles just like we would in flat, Euclidean space. Say the radius of the sphere is $R$ and the radius of the circle is $r$. Then, there is a useful angle that you can construct between the center of the circle, the center of the sphere and the edge of the circle as shown in the picture below.

The angle $\theta$ can be determined easily from the circle sector it makes with the radius of the circle, giving $\theta = r/R$. The radius of the circle in the surrounding 3D Euclidean space is $R\sin(\theta)$. Therefore, the circumference of the circle is $C = 2 \pi R\sin(r/R)$. Then, the value of pi is given by

$\Pi = \frac{C}{2r} = \frac{\pi \sin(r/R)}{(r/R)}$.

Interestingly, the value of $\Pi$ depends on the radius of the circle. To ensure that this makes sense, we can think about our own experiences living on a sphere. If we drew a circle on human scales, where the curvature of Earth isn’t noticeable, we would expect to see that (to a very good approximation) $\Pi=\pi$. That is indeed the case here, as you can see in the graph below. The fact that at very small values of $r/R$, i.e. when the radius of the circle is much less than the radius of the sphere, the circle is well-approximated by a Euclidean circle and we have $\Pi=\pi$.

There is one last thing I want to mention about circles on the sphere. The value of $\Pi$ can be 0. This occurs when the radius is $\pi R$. At this radius, which is the largest radius possible on the sphere, the circle reduces to a single point on the exact opposite side of the sphere from the center of the circle (the antipodal point). Of course, the length of a point is 0, so the circumference disappears, and takes $\Pi$ with it.

###### Conclusion

This was fun little exercise in geometry, but I think it really highlights the importance of definitions in mathematics (and any other pursuit that requires very precise language). Taking the definition of $\Pi$ to be the ratio of a circle’s circumference to its diameter isn’t sufficient to set it to the unique value we call $\pi$. We must further define what it means to be a circle and what we mean by circumference in terms of the metric we use to measure it. Finally, you have to define where your circle lives, on a plane? a sphere? some oddly warped surface?

There are other interesting geometric definitions you could consider for $\Pi$, and I recommend replaying this whole game with them. For example, it could be the ratio of the area of the circle to the squared radius (this one is interesting in particular when you consider spherical geometry). The history of knowledge building was always enriched by people who came along and thought “what if I relax this assumption?” This post, being partly about spherical geometry is a direct descendent of such endeavors when mathematicians started to consider relaxing Euclid’s 5th axiom.