What's New
Q & A
Tip Jar
C# Helper...
Follow VBHelper on Twitter
MSDN Visual Basic Community
  Tutorial: Drawing Platonic Solids  

This article explains how to calculate the coordinates of the corners of the Platonic solids: tetrahedron, cube (hexahedron), octahedron, dodecahedron, and icosahedron.

Several of my writings involve the Platonic solids. For instance, some of the programs included with my book Visual Basic Graphics Programming draw these objects, though the book does not explain how to find the coordinates of the solids' vertices, it merely uses them. Much to my surprise, I received several requests for these derivations.

This article explains how to calculate the positions of the corners of the Platonic solids. Deriving these values requires only relatively simple algebra and a little trigonometry. Even so, they can be a bit involved so mistakes are certainly possible. After using the formulas shown here to find the points, I verified the results by writing test programs to verify that all of the edges on a side were the same length.

For programs that draw three-dimensional objects, see my book Visual Basic Graphics Programming.

1. What Are Platonic Solids? 2. Tetrahedron 3. Cube
4. Octahedron 5. Dodecahedron 6. Icosahedron

1. What Are Platonic Solids?

A regular polygon is a two-dimensional shape where each edge has the same length and the edges all make the same angles with respect to each other. Figure 1.1 shows two quadrilaterals. The square on the left is a regular polygon because all its sides are the same length and they all meet at 90 degree angles. The parallelogram on the right is not regular. While its sides have the same length, they do not all meet at the same angles.

Figure 1.1. A regular polygon (left) and a polygon that is not regular (right).

The Platonic solids were defined by the Greek mathematician and philosopher Plato (427-347 BC). They are all of the three-dimensional solids that you can define using faces that are identical regular polygons. These solids are also known as the three-dimensional regular polytopes.

The Platonic solids include the tetrahedron (4 triangular faces), cube or hexahedron (6 square faces), octahedron (8 triangular faces), dodecahedron (12 pentagonal faces), and the icosahedron (20 triangular faces).

There are no other regular polytopes in three dimensions. You may have seen solids made up of more faces, each of which is identical. For example, some game stores sell 30-sided and even 100-sided dice. The faces of these solids are parallelograms not regular polygons, so they are not regular polytopes. Similarly you can make geodesic domes using identical triangles. The triangles are not equilateral (they have different side lengths), however, so the dome is not a regular polytope.

There are other regular polytopes in higher dimensions. For example, "cubes" are defined for all higher dimensional spaces. There are four-dimensional cubes, five-dimensional cubes, etc. There are even some regular polytopes that do not correspond to any two- or three-dimensional polytopes.

Two-dimensional space has an infinite number of regular polytopes because you can make a regular polygon with any number of sides: triangle, square, pentagon, hexagon, and so forth. Four-dimensional space has the next most regular polytopes, although I can't remember how many it has or how many faces they have. I think I remember it having four-dimensional counterparts to tetrahedrons, cubes, and octahedrons (I think all dimensions have those) but I don't remember what else. If someone knows, email me.

The Platonic solids have some rather interesting dual relationships. To make the dual of a solid, place a vertex in the center of each of the solid's faces. Then connect each vertex to the vertices on the adjacent faces. For the Platonic solids, the result is another Platonic solid.

Figure 1.2 shows a cube and its dual: an octahedron.

Figure 1.2. A cube and its dual, an octahedron.

Table 1.1 lists the Platonic solids and their duals.

Table 1.1 The duals of the Platonic solids.

The number of vertices, faces, and edges in duals have a reciprocal relationship. For example, a cube has 6 faces and 8 vertices while an octahedron has 8 faces and 6 vertices. Both have 12 edges. Table 1.2 lists the number of faces, vertices, and edges in the Platonic solids.

Tetrahedron 4 4 6
Cube 6 8 12
Octahedron 8 6 12
Dodecahedron 12 20 30
Icosahedron 20 12 30
Table 1.2 The number of faces, vertices, and edges in the Platonic solids.

The number of faces, edges, and vertices are related to the shape and arrangement of the faces. Define the following values:

F= Total faces in the solid
E= Total edges in the solid
V= Total vertices in the solid
EF= Number of edges on each face
VF= Number of vertices on each face
SE= Number of faces that share each edge (always 2)
SV= Number of faces that share each vertex


E= F * EF / SE
V= F * VF / SV

For example, an icosahedron has 20 triangular faces with each vertex shared by 5 faces so F = 20, EF = 3, VF = 3, SE = 2, and SV = 5. Plugging these numbers into the previous equations gives:

E= 20 * 3 / 2= 30
V= 20 * 3 / 5= 12

2. Tetrahedron

A tetrahedron has four faces that are equilateral triangles. In an equilateral triangle, the sides meet at 60 degree angles. Figure 2.1 shows a tetrahedron.

Figure 2.1. A tetrahedron.

It is a trigonometric fact that in a triangle with angles of 30, 60, and 90 degrees, the sides have relative lengths of 1, 2, and Sqr(3) as shown in Figure 2.2. These lengths are not absolute--they are relative to each other. For example, if the short side has length 4, the other sides have lengths 4 * 2 and 4 * Sqr(3).

Figure 2.2. The 30-60-90 triangle has sides with relative lengths of 1, 2, Sqr(3).

Imagine looking at the tetrahedon from the top as shown in Figure 2.3. By symmetry, the projections of the sides of the tetrahedron bisect the angles in the solid's base. Those angles are each 60 degrees, so the bisected angles are 30 degrees. Since one of the other angles in this smaller triangle is 90 degrees, the remaining angle must be 180 - 90 - 30 = 60 degrees.

Now suppose the sides of the tetrahedron have length 2. Then the longer side next to the right angle in the smaller triangle has length 1 because it is half of the larger triangle's side. This corresponds to the side with length Sqr(3) in the 30-60-90 triangle with side lengths 1, 2, Sqr(3). For the sides of this smaller triangle to have the correct relative lengths, the other two sides must have lengths 1/Sqr(3) and 2/Sqr(3). To verify that these lengths are correct, multiply the lengths 1/Sqr(3), 2/Sqr(3), and 1 by Sqr(3) and you will see that the sides have relative lengths 1, 2, Sqr(3). This situation is shown in Figure 2.3.

Figure 2.3. Top view of a tetrahedron.

Now suppose you want the top point of the tetrahedron to lie in the Z axis, and the bottom face to lie in the X-Y plane. Then the values shown in Figure 2.3 give the coordinates of all four points with the exception of the Z coordinate of the top point as shown in Figure 2.4.

Figure 2.4. Most of the coordinates for a tetrahedron's vertices.

Now imagine looking at the tetrahedron from the side, looking parallel to the X axis. Figure 2.5 shows the tetrahedron from almost this angle. The view is tilted just a little so you can still see all four sides.

Figure 2.5. Calculating the Z coordinate of the tetrahedron's top point.

We have assumed that the tetrahedron's edge lengths are 2 so the distance A in Figure 2.5 is 2. We know from Figures 2.3 and 2.4 that the distance B is Sqr(3) - 1/Sqr(3). Because sides A, B, and z form a right triangle, z * z + B * B = A * A. Solving for z gives z = Sqr(A * A - B * B). Plugging in the values of A and B gives:

    z = Sqr(2 * 2 - (Sqr(3) - 1/Sqr(3)) * (Sqr(3) - 1/Sqr(3)))
      = Sqr(4 - (3 - 2 + 1/3))
      = Sqr(3 - 1/3)
      = Sqr(8/3)
      = 2 * Sqr(2/3)
Thus the coordinates of the tetrahedron's vertices are:
    ( 0, Sqr(3) - 1/Sqr(3),            0)
    (-1,        - 1/Sqr(3),            0)
    ( 1,        - 1/Sqr(3),            0)
    ( 0,                 0, 2 * Sqr(2/3))
To verify that these values are correct, you can write a program that calculates the distances between each pair of these points. All of the distances should be 2. Click here to download a program that performs this verification.

3. Cube

The cube is an easy one. If you want the cube's sides to be 2 units long and you want the cube centered at the origin, the cube has vertices at:
    (-1, -1, -1)
    (-1,  1, -1)
    ( 1, -1, -1)
    ( 1,  1, -1)
    (-1, -1,  1)
    (-1,  1,  1)
    ( 1, -1,  1)
    ( 1,  1,  1)
Click here to download a program that verifies this.

Figure 3.1. A cube.

4. Octahedron

The octahedron is also straightforward. If you place the solid's vertices on the coordinate axes as shown in Figure 4.1, the points are located at:
    ( 1,  0,  0)
    ( 0,  1,  0)
    ( 0,  0,  1)
    (-1,  0,  0)
    ( 0, -1,  0)
    ( 0,  0, -1)

Figure 4.1. An octahedron.

Click here to download a program that verifies the points. Note that these coordinates define the dual of the previously described cube.

5. Dodecahedron

You can find the vertices of a dodecahedron using calculations similar to those used for the icosahedron shown in the next section but I'm too lazy to reproduce them here. If you need the vertices' coordinates, you can take the dual of the icosahedron. Or see my book Visual Basic Graphics Programming which explains the derivation in detail.

6. Icosahedron

Figure 6.1 shows an icosahedron with its hidden surfaces removed.

Figure 6.1. An icosahedron with hidden surfaces removed.

Figure 6.2 shows the same icosahedron with hidden surfaces drawn in dashed lines and its nodes labeled a through l.

Figure 6.2. An icosahedron with nodes labeled.

The icosahedron is centered at the origin in these figures. Points a and l lie on the Z-axis so they have X and Y coordinates 0. Points b and g lie in the Y-Z plane so they have X coordinate 0.

Let Z1 be the Z coordinate of point a and let Z2 be the Z coordinate of points b through f. By symmetry, the Z coordinate of point l is -Z1 and the Z coordinate of points g through k are -Z2.

To calculate the points' X and Y coordinates, look at the icosahderon from the top. Consider only the positions of points b through f and g through k as shown in Figure 6.3.

Figure 6.3. An icosahedron viewed from the top.

The two pentagons that contain the points b through f and g through k allow you to calculate the points' X and Y coordinates. Let S be the length of one of the icosahedron's edges and consider just the right half of the upper pentagon shown in Figure 6.4. You can use the angles t1, t2, t3, and t4 to calculate the points' coordinates.

Figure 6.4. Calculating the X and Y coordinates for points b, c, and d.

Because the nodes are arranged in a pentagon, t1 = 2 * Pi / 5 and

    t2 = Pi / 2 - t1
       = Pi / 2 - 2 * Pi / 5
       = Pi / 10
Similarly t4 = 2 * Pi / 10 = Pi / 5 and:
    t3 = -(Pi / 2 - t4) = -(Pi / 2 - Pi / 5)
       = -3 * Pi / 10

Using trigonometry in the t4 triangle, R = (S/2) / Sin(t4). With this value, you can calculate H = Cos(t4) * R. Using these values, we have the coordinates for points b and d:

    b = (  0,  R, Z2)
    d = (S/2, -H, Z2)
Similarly the X and Y coordinates of point c are R * Cos(t2) and R * Sin(t2). For notational convenience, let these values be Cx and Cy.

Using the symmetry shown in Figure 6.3, you can calculate the coordinates for all of the rest of the points.

    a = (   0,   0,  Z1)
    b = (   0,   R,  Z2)
    c = (  Cx,  Cy,  Z2)
    d = ( S/2,  -H,  Z2)
    e = (-S/2,  -H,  Z2)
    f = ( -Cx,  Cy,  Z2)
    g = (   0,  -R, -Z2)
    h = ( -Cx, -Cy, -Z2)
    i = (-S/2,   H, -Z2)
    j = ( S/2,   H, -Z2)
    k = (  Cx, -Cy, -Z2)
    l = (   0,   0, -Z1)
    S  = the side length (given)
    t1 = 2 * Pi / 5 
    t2 = Pi / 10
    t4 = Pi / 5 
    t3 = -3 * Pi / 10
    R  = (S/2) / Sin(t4)
    H  = Cos(t4) * R
    Cx = R * Cos(t2)
    Cy = R * Sin(t2)
The only values left to calculate are Z1 and Z2. Consider the top of the icosahedron shown in Figure 6.5. Look again at Figure 6.4 to see how the value R fits into this picture.

Figure 6.5. The top of an icosahedron.

We know S and R, so we can calculate H1:

    H1 = Sqr(S * S - R * R)
Now consider one of the pentagons on the side that contains the points a, b, and i as shown in Figure 6.6. Let H2 be the vertical distance between points a and i. We have already seen that the Y coordinate of point i is H so the horizontal distance along the Y-axis between these points is H as shown in the figure.

Figure 6.6. The side of an icosahedron.

The hypotenuse of the triangle with sides H and H2 is the height of the pentagon containing points a, b, and i. Figure 6.4 shows that distance is H + R. You can now use these values to solve for H2.

    H2 = Sqr((H + R) * (H + R) - H * H)
Finally, you can use the values of H1 and H2 to calculate Z1 and Z2.
    Z2 = (H2 - H1) / 2
    Z1 = Z2 + H1
To verify that these values are correct, you can write a program that calculates the distances between each pair of these points. All of the distances should be S. Click here to download a program that performs this verification.


Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.