There are two important mappings involved in this image: rotations and
projections. The idea of the shadow is represented mathematically by
projection, of which there are two basic types. The first is
orthographic projection, which corresponds to a light source that is
infinitely far away. In this form of projection, an object's
shadow is always the same size as the object itself, regardless of its
distance from the shadow. (This form of projection is described in more
detail for "Iced Cubes".)
The second form is the stereographic projection. This corresponds
to having the light source at a finite distance from the surface on
which the shadow falls. In this case, the shadows of objects close to the
light source are larger than shadows of objects farther from the light.
(Experiment with hand shadows from a lamp in a darkened room to see how
this works.) Mathematically, the stereographic projection from the point
(0,0,0,d) in fourspace onto the xyz hyperplane (i.e., into
threespace) is given by the map p_{d}: R^{4} > R^{3}
where

p_{d}(x,y,z,w) 
 =  


(x,y,z). 
 

for all points where w ¹
d.
In our case, the object projected is the hypercube having corners at (±1,±1,±1,±1), and our projection
point has d = 4. But our cube is rotated before it is
projected. A rotation can be represented by matrix multiplication, for
example, to rotate fourspace so that the xaxis rotates toward the
waxis through an angle of q, one can
use the function:

R_{q}(x,y,z,w) 
 =  
æ ç ç ç è 

cos q 

0 

0 

sin q 

0  1  1  0 

0  1  1  0 

sin q 
0  0 
cos q 
 
ö ÷ ÷ ÷ ø 

æ ç ç ç è 

ö ÷ ÷ ÷ ø 
. 
 

Mapping the corners of the hypercube through this rotation map, and then
through the projection map gives the positions in threespace of the
shadow of the hypercube.
To form the edges of the hypercube, we start by forming the edges of a
standard cube in threespace, then add a fourth coordinate that is 1. Then we make a second cube and add a fourth
coordinate that is 1. (These two cubes are the ones we colored yellow and
orange.) Finally, we add edges between corresponding corners of these two
cubes. This forms the skeleton of the hypercube seen in this image.