← Back to Vibes

Triangle Shape Space

The hidden topology of the simplest polygon

What is the topological space of shapes of triangles? It sounds like a question one might encounter in elementary school geometry, yet even in university courses, we rarely discuss the "shape space" of this simple object.

The Concept of Shape Space

A topological space is a mathematical set with a structure that allows for the definition of continuous deformation. When we talk about the "shape space" of a triangle, we are asking: if we continuously change the shape of a triangle by small amounts, what kind of surface or object do we trace out?

Consider a triangle. It is defined by 3 vertices, or 3 side lengths, or 2 angles and a size. However, for "shape," size does not matter. A large equilateral triangle has the same shape as a small one. Similarly, position and rotation in space do not matter. We are interested only in the intrinsic shape.

Since a triangle is well-defined by 3 parameters (e.g., side lengths) and one is ruled out by the size (scaling), the space of all possible triangle shapes is 2-dimensional. It forms a surface. But what surface? A plane? A cylinder?

Jacobi Coordinates

To visualize this, we can use a coordinate system often used in the three-body problem, known as Jacobi coordinates. Let the positions of the three vertices be vectors $\mathbf{r}_1, \mathbf{r}_2, \mathbf{r}_3$. We define two Jacobi vectors:

$$\rho_1 = (r_2 - r_1) / \sqrt{2}$$ $$\rho_2 = (2r_3 - r_1 - r_2) / \sqrt{6}$$

These vectors describe the relative positions. $\mathbf{\rho}_1$ is the vector between the first two vertices (scaled), and $\mathbf{\rho}_2$ is the vector from the midpoint of the first two to the third (scaled).

From these, we can construct 3 coordinates $(w_1, w_2, w_3)$ that define the shape:

$$w_1 = |\mathbf{\rho}_1|^2 - |\mathbf{\rho}_2|^2$$ $$w_2 = 2(\mathbf{\rho}_1 \cdot \mathbf{\rho}_2)$$ $$w_3 = 2(\mathbf{\rho}_1 \times \mathbf{\rho}_2) \cdot \mathbf{e}_z$$

Remarkably, these coordinates satisfy $w_1^2 + w_2^2 + w_3^2 = I^2$, where $I$ is related to the moment of inertia (size).

To look at the shape alone, we normalize these coordinates by the size $I = |\mathbf{\rho}_1|^2 + |\mathbf{\rho}_2|^2$. This gives us the coordinates on the Unit Sphere:

$$ x = \frac{|\mathbf{\rho}_1|^2 - |\mathbf{\rho}_2|^2}{|\mathbf{\rho}_1|^2 + |\mathbf{\rho}_2|^2}, \quad y = \frac{2(\mathbf{\rho}_1 \cdot \mathbf{\rho}_2)}{|\mathbf{\rho}_1|^2 + |\mathbf{\rho}_2|^2}, \quad z = \frac{2(\mathbf{\rho}_1 \times \mathbf{\rho}_2) \cdot \mathbf{e}_z}{|\mathbf{\rho}_1|^2 + |\mathbf{\rho}_2|^2} $$

These satisfy $x^2 + y^2 + z^2 = 1$.

The Shape Sphere

The topology of triangle shapes is a sphere! Every point on this sphere corresponds to a unique triangle shape.

Shape Sphere (3D)

Projection (Top View)

Triangle View

Interact with the sphere or the projection (use button to switch hemispheres).

In the visualization above:
• The Sphere shows the manifold of all shapes.
• The Red Points on the equator are collision points (2 vertices same).
• The Cyan Lines connecting poles are isosceles triangles.
• The Yellow Circles are right triangles.
• The Poles are equilateral triangles.