I’m quite proud to be featured once again, and hope there’s more to come!
Want to support my work? Consider making a donation:
I’m quite proud to be featured once again, and hope there’s more to come!
I just updated these three animations. The old ones I had on Wikipedia were among the first I’ve ever done, and were ugly, tiny and outdated.
What you’re seeing here is how a periodic function (in blue) can be approximated by a Fourier series (in red). The number N shows how many terms are being used.
A Fourier series is just a sum (usually infinite) of sines and cosines of different frequencies and amplitudes that approximates a desired function. These frequencies and amplitudes constitute what we call the frequency domain of the function, though this is more useful when we consider a continuous spectrum of frequencies.
The function doesn’t need to be continuous, as you can see in the case of the square and the sawtooth wave.
However, the Fourier series approximation does get a bit wacky around the discontinuities. The wavyness near those points never really goes away, but it usually stays within a certain limit. This is known as Gibbs phenomenon, and it’s a familiar problem in signal processing.
Due to the simplicity of sines and cosines, Fourier series are a great tool when studying the behavior of more complicated periodic functions, a common problem in differential equations with extremely wide applications in physics and engineering.
An important aspect of all of this that gets brushed over in most classes is that you don’t really need both sines and cosines in a Fourier series, since the sum of a sine and a cosine of the same frequency is just a senoidal function with a different phase and amplitude. In other words, you only use sine and cosines in order to encode a phase.
This is why Fourier series are much more elegantly handled using complex numbers, as the complex exponential can handle both phase and amplitude very succintly.
In the future I’m hoping to make a post explaining, in terms most people with a basic understanding of math can understand, why all of this Fourier analysis stuff works in the first place, and why you should think it is awesome. Because it is very awesome.
I’ve been making these educational animations for Wikipedia for years now. It has always been a completely volunteer effort, and I never really got anything from it other than the joy of learning new things about math and physics, and being able to show them to others in a memorable, intuitive and visually pleasing way.
I just wanted people to understand how cool math and physics are, and how simple some complicated looking things can be if you look at them the right way. And to my great pleasure, it has worked really well so far!
Over the years, the reactions have been very positive, especially since I created this tumblr blog. It’s been very exciting to see so many people getting enthusiastic about math and physics because of my work.
But lately, things have been a bit rough, and free time has been scarce. Being a college student takes its toll on anyone, and living off a tiny student grant and my personal savings (one of the reasons why I started college so late) is pretty tough.
So I decided to open up for donations. If you like my work and feel that it is worth something to the world, then consider making a donation. Anything would help me worry less about money and survival, and more about learning stuff and getting me motivated to spend more time on making more cool animations to help others.
You can find the donate button at the top right, on the blog header, or you can follow this link. Any help would be immensely appreciated.
Thank you all for the love and support so far! It means the world to me.
Also known by the Greek letter φ (phi), this curious irrational number has a closed-form given by:
φ = (√5 + 1)/2 = 1.61803398875…
From nautilus shells, the human body to spiral galaxies, the Golden Ratio seems to be everywhere in Nature, right?
Well, not really.
A very large portion of what you have probably heard about this number is just hype, widely propagated myths, extremely far-fetched analysis of data or, putting it mildly, just made-up nonsense.
Now, don’t get me wrong here. The Golden Ratio really is a very interesting number with a number of outstanding mathematical properties. This is why it saddens me to see so many people praising it for all the wrong (and wildly innacurate) reasons.
For instance, several spirals in nature are logarithmic spirals because they are the same independent of the scale. This sort of thing is bound to show up whenever you have exponential growth in a circular fashion, two phenomena that are extremely common in nature. In the end, logarithmic spirals are really just exponential functions in polar coordinates.
However, not all logarithmic spirals are Fibonacci spirals. In fact, what it is known as the Fibonacci or Golden spiral, derived from the famous construction using nested squares and golden rectangles (shown below), is a very gimmicky geometric construction that really shouldn’t be expected to show up in nature at all. Nature doesn’t work with squares and rectangles!
In the study of aesthetics, the Golden Ratio is often praised as being the most beautiful ratio for things, a dogma that gets passed around a lot in design circles. Several studies have shown no correlation between the Golden Ratio and a sense of beauty or aesthetics. (check links at the end of the post for more on this)
I could list most of these myths here, but I would just be repeating what has already been said by many others. So if you want to find out what’s true and what isn’t about the Golden Ratio, I recommend that you watch this talk by Keith Devlin or read this article by Donald Simanek. More links and resources can be found a the end of the post.
With that usual Golden Ratio crap out of the way, I can now finally talk about why this number is REALLY cool.
Irrational numbers are numbers that cannot be expressed as the ratio of two integers. Note that the keyword here is integers. This little important detail gets a lot of people confused, usually because of π.
While π is usually defined as the ratio between the circumference of a circle by its diameter, you cannot have both of those quantities being whole numbers, because π happens to be irrational. You can approximate an irrational number with rational approximations, such as 22/7 = 3.142857142857… or 3141592/1000000 = 3.141592, but no matter how large the two numbers of the ratio are, you’ll never find a ratio that is exactly π. The same is true for any other irrational number, φ included.
That animated infinite fraction you see at the top is an example of what we call an infinite continued fraction. Continued fractions are a powerful way to represent irrational numbers because they show you how good a rational approximation is: larger terms in the continued fraction mean you are adding smaller corrections, which tells you the approximation is good. Additionally, all irrational numbers have unique infinite continued fraction representations, a very useful property.
But since we know the larger terms mean “better approximations”, we can think of what would be the worst approximation ever for any number. This would be the infinite continued fraction where the terms are the smallest integer available: 1.
And, it turns out, this infinite continued fraction represents the number φ! This is what the animation is representing.
Think about that for a second. There are an infinite number of irrational numbers, and of all of them, φ is the absolute worst number to approximate using a ratio of two whole numbers. In a sense, φ can be said to be the “most irrational” of all irrational numbers!
This makes me wonder why we even call φ the “Golden Ratio” to begin with, as it is the one number that is as far from being a ratio as it is mathematically possible.
This “super-irrationality” of φ can be pretty useful, and it is one of the reasons (if not the only one, other than those related to pentagonal symmetries) why approximations of φ show up in Nature, for real this time.
Imagine you have a periodic process, such as leaves growing on a plant stem. If one leaf grows directly on top of another, the leaf below will not be exposed to the Sun due to the shadow cast by the leaf above, so the leaf below will be pretty much useless.
Evolution would favor plants that add an offset between leaves, perhaps by having the stem twist as it grows. This would improve the amount of sunlight each leaf is exposed to, making the plant more efficient and giving it an evolutionary advantage.
However, if the amount of twist between consecutive leaves is a nice ratio of full turns, say 2/3, you would get an overlap between every 3rd leaf. So in this case, you don’t really want nice ratios. You want the leaves to be as spaced as possible, that is, you want the worst ratio you can think of.
As we already know, φ would be that ratio. However, φ cannot really exist out there in the real world, so approximations are as good as we can get.
And guess what? The rational approximations available for φ are the ratios between two consecutive Fibonacci numbers. But you probably knew that already.
This explains why Fibonacci numbers may show up in Nature. Whenever you have a periodic process that would benefit from being “as irregular as possible”, Fibonacci numbers are bound to show up as approximations for φ.
Let’s say you have a bunch of points that you want to distribute evenly on a disk, as efficiently as possible. This sort of problem shows up in Nature, like in the case of sunflower seeds.
The easiest way to do this, in terms of a set of basic rules, is by placing the points along a spiral, adding layer after layer of points.
But the BEST way to do it uses a very special spiral known as Fermat’s spiral, in which the radius is proportional to the square root of the angle, that is, r(θ) = k√θ, for some constant k.
Since the area of a disk grows with the square of its radius, this spiral has the property of “covering” equal amounts of area for the same amount of rotation.
If you pair this property with the irregular spacing mentioned previously, by picking points along this spiral in multiples of φ (in terms of full turns), you have a very simple rule to achieve the goal of distributing these points along the disk.
You can play around with this idea in the applet below. Apart from the sliders, you can also change the ratio using the left and right keys. Hold shift and/or control to increase the rate of change. You can also type in a fraction like 22/7 in the ratio text box and hit enter.
To be clear, the x and y coordinates of the n-th point will be: x = cos(2πkn)·r(n) and y = sin(2πkn)·r(n), where r(n) is the radius function (that is, the polar function for the chosen spiral) and k is the ratio being used to place the points around the spiral. Only the fractional part of k matters in this model.
You’ll see that most irrational numbers produce some pretty obvious patterns right away. φ and its reciprocal (in fact, the entire family of numbers sharing that same fractional part) are the only numbers that get everything as evenly spaced as possible, no matter how large the spiral is or how many points you use. In fact, even tiny variations from these ratios already ruin the whole pattern.
Picking different functions for the radius will reveal how Fermat’s spiral is special regarding the radial spacing between dots.
For fun, I also decided to plot lines connecting two consecutive points. You can get some pretty neat images with this, showing the patterns even more clearly. As expected, φ gets you the most messy and irregular of all images, as shown in the second image in this post. For comparison, I also included some other irrational numbers as ratios.
Now imagine that instead of a disk, you wanted to distribute points uniformly on the surface of a sphere. This problem shows up every now and then, and it cannot be solved so easily. The usual algorithms to solve it involve physical simulations of repelling particles with friction. After a long simulation time, the system will achieve a somewhat decent equilibrium state. This method is particularly troublesome if we’re talking about thousands of points, as we’d have to simulate the interaction between every possible pair of points.
However, we can do better than that. A spiral similar as the one for the disk can be used to distribute points across the surface of a sphere, in a way that makes them relatively uniform.
So thanks to φ and its irrational properties, we can tackle a hard problem in a relatively straightforward and direct way. Pretty clever stuff!
Well, there’s a lot of other cool stuff I could say about φ, but this post is already pretty long as it is and the links below are full of more stuff.
Next time you have a donut or bagel at hand, give this a try. Slice it diagonally in a way that the cutting plane is tangent to the donut both below and above its inner hole. If you do it just right, what you get is two perfectly symmetric pieces whose boundaries are the union of two perfect circles (for a sufficiently round donut).
Mathematically speaking, if you have a torus (what mathematicians call that donut shape) and cut it diagonally at the correct angle, you will reveal a pair of perfect circles on the surface of the torus, known as Villarceau circles.
For every point on the surface of a torus, you can trace exactly 4 distinct perfect circles, on the surface of the torus, that pass through that point: one is around the hole of the torus, and the other around its circumference. The other two are Villarceau circles, but not really the pair shown in the animation.
Villarceau circles play an important role in Hopf fibrations. Roughly speaking, you can fill the entire 3D space with an infinite number of such circles. Apparently, this sort of thing even shows up in quantum physics, but I can’t offer any information on that.
I was first introduced to the concept of Villarceau circles through this great POV-Ray render by Tor Olav Kristensen.
This was one of the first animations I did for Wikipedia, and I’m still rather proud of it.
On a side note, I’ve been very busy with college lately, that’s why I haven’t been posting much. But I’m working on a series of animations on vector calculus and electromagnetism, and I think they’ll turn out great. Stay tuned!
Hey, we’re doing line integrals over vector field right now, but it’s kind of the same idea. Congrats on the image of the day!
Thanks! By the way, I also made a vector field version:
A scalar field has a value associated to each point in space. Examples of scalar fields are height, temperature or pressure maps. In a two-dimensional field, the value at each point can be thought of as a height of a surface embedded in three dimensions. The line integral of a curve along this scalar field is equivalent to the area under a curve traced over the surface defined by the field.
In this animation, all these processes are represented step-by-step, directly linking the concept of the line integral over a scalar field to the representation of integrals familiar to students, as the area under a simpler curve. A breakdown of the steps:
Standing waves are an interesting physical phenomenon that show up in several places in nature. They’re a wave that oscillates “in place”.
One of the ways a standing wave can be created is by the interference of two waves travelling in opposite directions (like in the second image). By the superposition principle, the resulting wave (in black) is the addition of the both waves (red and blue).
This standing wave has points that remain fixed (called nodes, in red), where destructive interference always occurs, and points that oscillate the most (called antinodes), where constructive interference occurs.
Standing waves are behind the sound of virtually every acoustic musical instrument, whether it is a drum, a flute or a violin. The musician operates the instrument in a manner to generate a vibration, and the vibration is propagated and reflected throughout the instrument. The interference between all of the reflected waves generate standing waves, which is what ultimately produce the bulk of the sound we hear.
The waves shown here are one-dimensional, but this phenomenon occurs in two and three dimensions as well.
By studying how waves interfere and reflect, and how these generate standing waves, one can estimate the vibration and density inside a spherical body (such as the Sun or the Earth — read those links!) from measurements of oscillation on the surface, a very powerful tool for studying the inner workings of such structures.
In the third animation, for reference, we see the wave generated when opposing waves of different frequencies interfere.
In a previous post, I introduced an animation explaining radians. It used π (pi), the standard constant used to measure circles.
However, as I mentioned in that post, there’s an ongoing movement to promote the constant τ (tau) to be used instead. When dealing with radians, tau makes undeniably a lot more sense than pi: a quarter tau radians represents, precisely, a quarter of a full rotation around the circle. With pi, a quarter rotation is π/2. That’s just nonsense!
Quite a few people demanded a version of the animation with tau, though they didn’t even have to ask. I was already planning on making one!
Just as before, Tumblr forced me to get rid of a lot of the frames, so the animation here isn’t as smooth as it could be. Here’s the proper animation (click to go to the Wikimedia Commons details page).
Based on the same principle as the polygonal trigonometric functions.
This was requested a few times, but I had to figure how to draw polar stars first. Finally got around to it.
I won’t be updating the sound generator. Sorry.
Another one for Wikipedia. Tumblr forced me to cut the amount of frames in half. Here it is in its full, smooth glory.
However, only one of these angle units earns a special place in mathematics: the radian.
This animation illustrates what the radian is: it’s the angle associated with a section of a circle that has the same length as the circle’s own radius.
For a unit circle, with radius 1, the radian angle is the same value as the length of the arc around the circle that is associated with the angle.
In the animation, the radius line segment r (in red) is used to generate a circle. The same radius is then “bent”—without changing its length—around the circle it just generated. The angle (in yellow) that’s associated with this bent arc of length r is exactly 1 radian.
Making 3 copies of this arc gets you 3 radians, just a bit under half of a circle. This is because half of a circle is π radians. So that missing piece accounts for π - 3 ≈ 0.14159265… radians.
Our π radians arc is then copied once again, revealing the full circle, with 2π radians all around.
There are several great reasons to use radians instead of degrees in mathematics and physics. Everything seems to suggest this is the most natural system of measuring angles.
Radians look complicated to most people due to their reliance on the irrational number π to express relations to circle, and the fact the full circle contains 2π radians, which may seem arbitrary.
In order to simplify things, some people have been proposing a new constant τ (tau), with τ = 2π. When using τ with radians, fractions of τ correspond to the same fractions of a circle: a fourth of a tau is a fourth of a circle, and so on.
Tau does seem to make more sense than pi when dealing with radians, but pi shows up elsewhere too, with plenty of merits of its own.
I, for one, do enjoy the idea of tau being used, exclusively, as an angle constant, so that it immediately implies the use of radians. If such were the case, a student seeing Euler’s identity for the first time, but in terms of tau, would be immediately compelled to think in terms of rotations: eτi = 1 would instantly convey the idea of a full rotation, bringing you back where you started. That seems like a good thing.
So happy Pi day!
(or half-tau day, if you prefer!)
This is the second of three animations I’ll be posting today (here’s the first). Be sure to check them out later if you miss them!
This simplified things a lot, and created some interesting uses for the functions. However, since I could only have one value of radius for each angle (they were based on polar equations), I could not draw arbitrary shapes with a continuous line based on the [0,2π] interval.
The solution is to extend the idea to general closed curves, by using the position along the curve to define the sine and cosine analogues. In other words, we want “path trigonometric functions” for which the input parameter is the position along the path, and whose periods are the curve’s total arc-length.
But the concept of “sine” and “cosine”, as well as “trigonometric”, completely lose their meaning at this point. It has nothing to do with triangles or angles.
We’re now dealing with the functions x(s) (in blue) and y(s) (in red) that together describe the curve, by being used in the parametric equation r(s) = ( x(s) , y(s) ), where r(s) is a vector function and s is the arc-length. This is very standard stuff, so it isn’t incredibly exciting anymore.
Notice that if the green curve was a unit circle, the functions would become the usual sine and cosine.
But we do get to see what these functions look like and what they are doing. So here’s the coordinate functions for the arc-length parametrization of a pi curve!
Happy Pi day!
This is just the first post for today. There’ll be two more, so be sure to check them out later if you miss them!
Here’s an arc-length parametrization of a closed curve for the Greek lowercase letter pi, famously used for the circle constant, π = 3.1415926535897932384626… (that’s what I bothered memorizing!)
Arc-length parametrizations are also called unit-speed parametrizations, because a point moving along the path will move with speed 1: the point moves 1 unit of arc-length per 1 unit of time.
It is generally very hard, if not impossible, to find this parametrization in closed form. But it always exists for nice continuous curves. Since it has some pretty cool uses, just knowing it exists is a powerful enough tool for mathematicians to use it on other cool theorems.
Using computers, we can usually approximate it numerically to any degree of accuracy we desire. The basic algorithm is pretty simple: just make a table of arc-length for each value of t. Then, the unit parametrization is just reading the table in reverse: find t given arc-length. Some interpolation is usually necessary.
Whoops. I had queued that Pi post the wrong date, and couldn’t fix it in time. Sorry. :D
I feel like the guy who prints the obituary before the person has died. Oh well. I do have a couple of things planned for pi day, I’m just not sure if I’ll be able to finish them in time.
But I do have a new Wikipedia animation (pi-related, coincidentally) almost ready.