Home > JavaSketchpad > Gallery > Hypercube

# Hypercube

## N-Dimensional Visualization

This is a JavaSketch I created many years ago to attempt to explain to my friends how a multidimensional object can be visualized in two-space, or what it means to "draw a picture" of a hypercube (a four-dimensional object). In order to explain this process, it's best to review how we draw simpler (lower-dimensional) objects in the plane.

The JavaSketch begins with a geometric point P, which has no dimension. Drag P about in the JavaSketch; it has no length, width, or depth.

Now drag the red point labeled 1 an inch or so to the right (or press the button labeled 1. Segment). This creates a vector—an arrow representing distance and length—by which to move point P. The image of point P as it moves along this vector—P's locus—is a one-dimensional object: a line segment. So we can create a one-dimensional object out of a zero-dimensional object by translating it along some vector.

Now take the magenta point labeled 2 and drag it an inch or so in an upwards direction. This creates a second vector, and the image of the line segment, translated by a vector, is a square. If it doesn't look like a square, that's because your two vectors aren't perpendicular or aren't the same length. (Maybe it's a square viewed from an odd angle.) But for the sake of completeness, try to drag point 2 so that its vector is perpendicular and equal in length to the first vector (or press 2. Square). Now you have a square: a two-dimensional object created by translating a one-dimensional object according to some vector.

(Scroll down for more explanation.)

Sorry, this page requires a Java-compatible web browser.

Now the fun begins. If you can create a 2-D object from a 1-D object in the same way you created a 1-D object (the segment) from a 0-D object (point P), can you create a 3-D object by translating your square by some vector? Theoretically, yes: Drag point 3. But there's a problem: While the image of P translated by three vectors in turn might now look like a cube, it can't be a cube: the screen is flat (two-dimensional), and the picture of the cube lies within the plane of the screen. You really only have a two-dimensional drawing, because you can't drag the third vector perpendicular to the first two (i.e., you can't drag it out of the screen). The important realization here is that your choice of direction (and length) for the third vector is arbitrary (because it can't be perpendicular), and that rather than a cube you only have a picture of the cube. This picture is called a projection: you've projected a three-dimensional object (a cube) onto a two-dimensional surface (the screen).

If you can choose an arbitrary vector to visualize the third dimension, there's no reason you can't choose another arbitrary vector to visualize the fourth dimension. Drag point 4. The resulting image is a (projection of a) hypercube—a four-dimensional cube. Drag point 4 far away, so that its vector becomes very long, and you can see that a hypercube is just two (three-dimensional) cubes, with each vertex connected by a new (green) dimension. The three-dimensional cube is just two squares connected by a new (blue) dimension, and so on. And the process can be extended indefinitely: if you drag point 5, you'll create a 5-dimensional superhypercube.

With either the hypercube or the superhypercube showing, press the Spin button. When you do, the tips of your third and fourth vectors begin rotating around an invisible circle. Because these vectors aren't centered on the circle, spinning their tips causes them to change both angle and length. Remember that each vector corresponds to a dimension, so two vectors determine a two-dimensional object (a plane). Mathematically, one would say you're rotating a four-dimensional hypercube about the zw-plane. Nifty? You bet.

—Nick Jackiw, October 1997