An Exploration of Dimensions and 4D Geometry
What is the fourth dimension? What does it mean for there to be another?
First, let's explain what a dimension is. In essence, a dimension is just a direction. Imagine a man living on a line:
He can move either left or right on the line. We can understand this means he has one direction; the line is one-dimensional. Formally, any position on the line can be described with a single number. We can call that position on the line x.
Now, imagine we give him a ladder that he can move along his line.
He can now move left and right, and up and down. There are two directions; he can now move two-dimensionally. To describe any one position now, we need two numbers, x like before, as well as a new number y to show his ‘height’ on the ladder.
This should all feel very familiar, as you’ve seen 2d graphs like this in every math class for as long as you can remember. How does this help us understand 4d objects? Well, consider how Oliver (that’s his name now!) thinks about you. Yes, you! Looking at him on the screen, you're viewing him from another direction, which we can call the z axis (an 'axis' just means a direction). He can't turn towards the screen, so from his perspective you don't exist. However, what happens if you put your hand next to your screen?
You're not flat, but Oliver can still see the part of your hand that intersects with the area he can see, which is the flat plane of the screen. Imagining the intersection of your finger and the plane, you can see it's just something like a circle. We call this the cross-section of the plane and the finger.
Let's say we want to show Oliver what a cube is (you could use a more complex shape, but the math will get harder).
How could we do it? Well, imagine we take a magic floating cube next to the screen. If we move it fully from one side to the other, Oliver could see the whole thing, just through the individual cross-sections.
...but to him, what would it look like? Try to figure it out on your own before continuing.
Try turning and zooming in/out the simulation; you'll be able to do the same with all other simulations on this page.
It's a square. It makes sense; the cube is aligned to the plane, so when the cube enters or leaves the plane, all levels of the cube at that z-level enter/leave at the same time. Mathematically, we can see this by looking at the equation of the cube and plane. If we imagine Oliver to be the origin (where x, y, and z = 0) and the cube to be a 'unit cube' where the side length = 1, then we can say the plane is defined as
$$z = 0$$and the cube is defined as
$$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5}\\ {\displaystyle -0.5\leqslant z\leqslant 0.5} \end{gather*} $$so, to find the cross-section we can just plug the z value from the first equation to the second:
$$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5} \end{gather*} $$and, this is the equation of a square. Perfect! Now, let's get back to the point. What is the fourth dimension? First, extend your knowledge from the prior exercise to your own world-- the real world. You are Oliver. What does that mean? Well, try to imagine our entire universe-- everything, everywhere-- existing on a flat, three-dimensional 'hyperplane' (plane is specific to 2D). Now, there are still our three axes (\(x\), \(y\), and \(z\)), but there is also a fourth one, which we can call \(w\). As Oliver, you can't turn towards \(w\), but you can still understand it's there by extending your knowledge of how a 2D creature might exist in a 3D world. But, bad news; the magic floating unit cube is back, and now it has another dimension! Now, instead of just being a cube, it's a 4D hypercube, also called a tesseract. Rather than a cube, which is made up of six squares, or a square, which is made up of 4 lines, a tesseract is made of 8 cubes. Do you see the pattern?
Try to figure out why. How do you construct a cube from squares, or a square from lines?
Mathematically, it can be described as
$$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5}\\ {\displaystyle -0.5\leqslant z\leqslant 0.5}\\ {\displaystyle -0.5\leqslant w\leqslant 0.5} \end{gather*} $$So... what would you see? What object would appear in front of you as the hypercube moved through the w-axis? Think about it, and then scroll down.
You probably could've seen this coming, but it's a cube. Setting \(w\) to zero with the same logic we used earlier, you can see the cross-section is
$$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5}\\ {\displaystyle -0.5\leqslant z\leqslant 0.5} \end{gather*} $$as you can probably tell, this is the equation of a cube. Perfect. So, great. We can make cubes appear and disappear. But what about the fourth dimension? All those cool gifs of weird rotating geometries labeled tesseracts? What about those? Well, first let's revisit Oliver.
You might have noticed an issue with our earlier 'simulations' of the intersections. It assumes that the cubes are always aligned perfectly with the planes. But, what if that's not the case?
this is the same cube, rotated 45 degrees around each axis. Imagine what Oliver would see now, as the plane moves through the z-axis. Try to figure it out, and then test your thoughts:
first, there is a single point, which grows into a triangle, then grows into more complex shapes, before shrinking back into a triangle, then to a point, then disappearing. Just looking at the shape of the rotated cube, it makes sense; the plane first intersects the tip, then intersects along the pyramidical section of the cube, then begins reaching the other edges of the cube which add more complex sides, until it reaches the midpoint; and then begins shrinking on the other side, which is opposite to the first. How about the math, though?
First, we know the cube can be represented as $$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5}\\ {\displaystyle -0.5\leqslant z\leqslant 0.5} \end{gather*} $$ but what about the rotations? Well, for those of you who haven't learned matrices yet, there's a great math tool called a rotation matrix. It lets you rotate a position around the origin counterclockwise by some angle on some axis. To use it, we just need to take these three matrices: $$ \begin{gather*} R_{x} =\begin{pmatrix} 1 & 0 & 0\\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \end{pmatrix}\\ R_{y} =\begin{pmatrix} \cos \theta & 0 & \sin \theta \\ 0 & 1 & 0\\ -\sin \theta & 0 & \cos \theta \end{pmatrix}\\ R_{z} =\begin{pmatrix} \cos \theta & -\sin \theta & 0\\ \sin \theta & \cos \theta & 0\\ 0 & 0 & 1 \end{pmatrix} \end{gather*} $$ and multiply our coordinates \( \begin{equation*} \begin{bmatrix} x\\ y\\ z \end{bmatrix} \end{equation*}\)by them. We need to be careful the order we apply them; matrix multiplication is not commutative, meaning order does matter. If we multiply like this: $$ \begin{equation*} R_{z} \times R_{y} \times R_{x} \times \begin{bmatrix} x\\ y\\ z \end{bmatrix} \end{equation*} $$ which would seem to make sense; we do an \(x\) rotation, then a \(y\) rotation, then a \(z\) rotation; then, for every subsequent rotation, the axes we are rotating around will also be rotated. We don't want that, so instead we will use $$ \begin{equation*} R_{y} \times R_{x} \times R_{z} \times \begin{bmatrix} x\\ y\\ z \end{bmatrix} \end{equation*} $$ which is an extrinsic rotation; one that uses fixed axes. To see why, see here.
Now, let's multiply the matrices: $$ \begin{equation*} \begin{pmatrix} 1 & 0 & 0\\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \end{pmatrix}\begin{pmatrix} \cos \theta & 0 & \sin \theta \\ 0 & 1 & 0\\ -\sin \theta & 0 & \cos \theta \end{pmatrix}\begin{pmatrix} \cos \theta & -\sin \theta & 0\\ \sin \theta & \cos \theta & 0\\ 0 & 0 & 1 \end{pmatrix}\begin{bmatrix} x\\ y\\ z \end{bmatrix} \end{equation*} $$ $$ \begin{equation*} =\begin{bmatrix} x\cos^{2} \theta -y\sin \theta \cos \theta +z\sin \theta \\ x\left(\sin^{2} \theta \cos \theta +\sin \theta \cos \theta \right) +y\left(\cos^{2} \theta -\sin^{3} \theta \right) -z\sin \theta \cos \theta \\ x\left(\sin^{2} \theta -\sin \theta \cos^{2} \theta \right) +y\left(\sin^{2} \theta \cos \theta +\sin \theta \cos \theta \right) +z\cos^{2} \theta \end{bmatrix} \end{equation*} $$ It's a bit of a big vector, but remember that our theta is 45 degrees, and that $$ \begin{equation*} \sin 45 =\cos 45 =\frac{\sqrt{2}}{2} \end{equation*} $$ Using that property and simplifying gives us this final vector: $$ \begin{equation*} =\begin{bmatrix} \frac{x-y+z\sqrt{2}}{2}\\ \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y-2z}{4}\\ \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y+2z}{4} \end{bmatrix} \end{equation*} $$ So, this tells us that $$ \begin{gather*} x'=\frac{x-y+z\sqrt{2}}{2}\\ y'=\frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y-2z}{4}\\ z'=\frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y+2z}{4} \end{gather*} $$ The apostrophe means that those are the rotated positions. So, great! We have the system of equations that will give us a position rotated by 45 degrees on each axis. Now, how do we turn this into a rotated cube? Try to figure it out, and then scroll down!
Well, first, look at our earlier inequalities we used to describe a cube: $$ \begin{gather*} {\displaystyle -0.5\leqslant x\leqslant 0.5}\\ {\displaystyle -0.5\leqslant y\leqslant 0.5}\\ {\displaystyle -0.5\leqslant z\leqslant 0.5} \end{gather*} $$ What that's saying is that the \(x\), \(y\), and \(z\) values have to be between -0.5 and 0.5; this forms a cube with side length 1 centered at \((0, 0, 0)\). Great. We already know this. But, what if instead, we said this: $$ \begin{gather*} -0.5\leqslant x'\leqslant 0.5\\ -0.5\leqslant y'\leqslant 0.5\\ -0.5\leqslant z'\leqslant 0.5 \end{gather*} $$ A little weirder, but it still looks right. But think about what it really means; \(x'\), \(y'\), and \(z'\) are all defined in terms of \(x\), \(y\), and \(z\). This means what we're really solving for is the \(x\), \(y\), and \(z\) values which, when rotated by \(\theta\), form a normal cube. Understand the difference of that and finding the \(x\), \(y\), and \(z\) values which form a cube rotated by \(\theta\). There's a trick to it, though; there's only one cube which, when rotated by \(\theta\), is a normal cube. It's a cube rotated by \(-\theta\). That way, the rotations cancel out and the cube is back to where it started. This means that when we set the \(\theta\), we're actually rotating the cube by \(-\theta\).
...however, we don't really need to worry about this. Careful readers would have noticed that earlier, I said that rotation matrices rotate counterclockwise. In reality, we want to be rotating clockwise; so, reversing the direction of the rotation is actually correct in this case. Now, great! We have these inequalities, which create our rotated cube: $$ \begin{gather*} -0.5\leqslant x'\leqslant 0.5\\ -0.5\leqslant y'\leqslant 0.5\\ -0.5\leqslant z'\leqslant 0.5 \end{gather*} $$ and, let's expand them with our earlier definitions: $$ \begin{gather*} -0.5\leqslant \frac{x-y+z\sqrt{2}}{2} \leqslant 0.5\\ -0.5\leqslant \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y-2z}{4} \leqslant 0.5\\ -0.5\leqslant \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y+2z}{4} \leqslant 0.5 \end{gather*} $$ This is the full system of equations of our rotated cube. Now, how can we find the cross-section of this rotated cube and Oliver's plane (the xy plane)? Try to figure it out, and then scroll down.
Now, this should feel somewhat familiar; we had the same problem earlier with a normal cube. Last time, we just set the \(z\) to 0, and this time we want to do something very similar. Take a look at the third inequality: $$ \begin{gather*} -0.5\leqslant \frac{x-y+z\sqrt{2}}{2} \leqslant 0.5\\ -0.5\leqslant \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y-2z}{4} \leqslant 0.5\\ -0.5\leqslant \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y+2z}{4} \leqslant 0.5 \end{gather*} $$ remember, that section is equal to \(z'\), or the \(z\) value of the rotated cube after it is rotated back into a normal cube. We want to set the z to be 0 when it is still rotated, because that's what we're gonna actually see. Clearly, the variable that does that is \(z\). Now, if we say \( \begin{equation*} z=0 \end{equation*}\), $$ \begin{gather*} -0.5\leqslant \frac{x-y}{2} \leqslant 0.5\\ -0.5\leqslant \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y}{4} \leqslant 0.5\\ -0.5\leqslant \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y}{4} \leqslant 0.5 \end{gather*} $$ This is some shape in terms of \(x\) and \(y\), which immediately can tell us that it's a shape Oliver can see. We could break this down further, but at this point it's easiest to just plot it and find out. Let's see!
It looks like some sort of irregular hexagon. Interesting!
You could have figured out this would have been some sort of hexagon before we did any math-- for an extra challenge, figure out how!
If we shift the shape around on the z-axis, we can see the different sections. You can acheive this by adding another term to the equations, to represent the z-shift. We'll call it \(k\). In our new system, $$ \begin{gather*} -0.5\leqslant \frac{x-y+( z-k)\sqrt{2}}{2} \leqslant 0.5\\ -0.5\leqslant \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y-2( z-k)}{4} \leqslant 0.5\\ -0.5\leqslant \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y+2( z-k)}{4} \leqslant 0.5 \end{gather*} $$ and with \( \begin{equation*} z=0 \end{equation*}\), $$ \begin{gather*} -0.5\leqslant \frac{x-y-k\sqrt{2}}{2} \leqslant 0.5\\ -0.5\leqslant \frac{\left( 2+\sqrt{2}\right) x-\left(\sqrt{2} -2\right) y+2k)}{4} \leqslant 0.5\\ -0.5\leqslant \frac{-\left(\sqrt{2} -2\right) x+\left( 2+\sqrt{2}\right) y-2k)}{4} \leqslant 0.5 \end{gather*}$$ try playing around with this in Desmos! This is already a massive block of math so I'm going to move onto different stuff now, but have some fun with it! Try looking at different rotations, or even different shapes!
ps. if you want to check this out on Desmos, go here.
Phew. For anyone who didn't check out the math section, it was a lot. But, we're free now! If you just went through that with me, maybe go grab a cup of water, take a break for a moment. I know I did.
...but, now, we're back to it. So! You probably saw this coming, but, again, you are Oliver. The magic floating hypercube rotated 45 degrees on each axis, and now it's intersecting our 3D hyperplane. What would we see? Think, and then scroll down.
...wait, but before we get there, hold on a second. What does it mean for a hypercube to be 'rotated' ? This brings us to our next question-- what is a rotation? First, consider our world. Good ol' \(x\), \(y\), and \(z\). How many rotations are there? Three, of course. But what about 2D? Let's go back to Oliver. How can he rotate?
Just one, of course. But hang on; we always talk about rotating around the x-axis, or the y-axis, or the z-axis. If there's one for each axis, why can't he rotate in two ways-- one for \(x\), and one for \(y\)? The reason is that there isn't one rotation for each axis. At least, not usually. In reality, there's one rotation for each plane. He has one plane; xy. We have three planes, xy, xz, and yz. Our hypercube has 6: xy, xz, xw, yz, yw, and zw.
Only in three dimensions is there the same number of axes and planes!
So, if that's the case, which of those planes will we rotate? For the sake of it, we'll for now say xw; but, we're going to come back to this later. Now, for real this time, what do you think it'll look like?
Looks weird, right? But, thinking about what it is, it makes sense. We're starting at one edge of the hypercube and moving towards the longer midsection. Now, what if there's more than one rotation, like how we rotated the earlier cube 45 degrees on every axis? This hypercube is rotated by 45 degrees on xw, yw, and zw. Check it out, and try to understand why.
it seems almost similar to the simulation with the cube, right? It begins with a point, before growing to a pyramid-- like the cube's triangle-- before growing into more complex and harder to describe shapes as more faces intersect with the hyperplane. Then, once it reaches its midpoints, it symmetrically shrinks back down to a point.
...and, that's it. That's pretty much all I've got for you. For fun, here's a simulation where you get all the control. Go wild, try to figure out what's going on.
...hey! You're still here! Wanna learn one more thing?
Have you ever seen one of these things?
They always call themselves 4D... but how is it? We never talked about that, right? Well, we've been talking about cross-sections. This is a different way of representing them, called projection. It's the more common (and more boring) way of doing it; you just take all the points, and apply a matrix to get it down to \( \begin{equation*} \begin{bmatrix} x\\ y\\ z \end{bmatrix} \end{equation*}\). For example, you can use an 'orthographic' projection, where you take (\(x\), \(y\), \(z\), \(w\)) and truncate it down to (\(x\), \(y\), \(z\)). That's it. If you want, you can play with one here:
Thanks for checking out this explainer!