When building visualizations of higher-dimensional objects, one must make a choice of how to represent the excess of data in our more limited physical space. One choice is to show slices of higher-dimensional objects. Another is to apply a projection that condenses the data by one dimension, and a perspective projection from a selected viewpoint is commonly employed.

Given that a perspective projection will be used, the next question is how much of the original data needs to be actively transformed and what details of the projection can be inferred. As part of this question, one needs to know how straight lines between higher-dimensional points will transform under the projection. The answer is second nature to artists such as painters, but not necessarily immediately manifest from an algebraic point of view.

Begin with the simple case of projecting a line in three dimensions onto a two-dimensional plane with respect to a point in the third dimension. For simplicity of calculation, let the perspective point lie on the z-axis at a distance d from the origin. A line from the perspective point to any three-dimensional point can be parametrized as

$[0,0,d] +t [x,y, z-d]$

where the parameter t runs from zero at the perspective point to one at the arbitrary point. Let the two-dimensional plane lie parallel to the x- and y-axes, crossing the z-axis at a distance p from the origin. The line from the perspective point will intersect this plane when its z-coordinate equals p:

$d+t(z -d) =p → t=d-p d-z$

For this value of the parameter, the first two coordinates of the arbitrary point are

$[ d-p d-zx , d-p d-zy ]$

and this is a general formula for a perspective projection from three to two dimensions. If the perspective point is located at unity on the z-axis and the xy-plane passes through the origin, the general projection becomes

$[ x1-z , y1-z ] , d=1 , p=0$

which is a commonly encountered form for stereographic projection. If the perspective point is allowed to approach infinity, the general projection becomes

$[x,y] , d→∞$

which is an orthographic projection in which the z-coordinate is simply ignored.

Now apply the general projection to a line between two arbitrary points. A parametrization of the line in three dimensions is

$[x0, y0, z0] +t [x1 -x0, y1 -y0, z1 -z0]$

Projection of the endpoints gives the two-dimensional points

$[d-p d-z0 x0, d-p d-z0 y0] [d-p d-z1 x1, d-p d-z1 y1]$

so that a parametrization of the projected line in two dimensions can be written

$(d-p) [x0 d-z0, y0 d-z0 ] +(d-p) t [x1 d-z1 -x0 d-z0, y0 d-z0 -y1 d-z1 ]$

which matches the projected endpoints for t = 0 and t = 1 by construction. Instead of projecting the endpoints and joining them, consider a projection of the parametrization of the entire three-dimensional line:

$(d-p) [x0 +t(x1 -x0) d-z0 -t(z1 -z0), y0 +t(y1 -y0) d-z0 -t(z1 -z0) ]$

Here is the crux of the matter: this equation does not look like a line in two dimensions because the parametrization variable appears in the common denominator of both fractions, unlike the form directly above it. A quick plot of the parametrization, however, indicates that it is indeed a straight line. This fact would be immediately clear to a perspective painter, but does not automatically fall out of the algebra.

One way to test this expression for possible curvature is to calculate a unit tangent vector for this vector function. This is done by differentiating with respect to the variable of parametrization and normalizing the result. The derivative of the vector function is

$d-p [d-z0 -t(z1 -z0) ]2 [(x1 -x0) (d-z0) +x0(z1 -z0), (y1 -y0) (d-z0) +y0(z1 -z0) ]$

This expression can be simplified a bit, but that is not necessary for the main point of the argument. The dependence of this expression on the variable of parametrization is now separate from the individual vector components and will disappear when the vector is normalized. That means the unit tangent vector is constant: the expression has no curvature and thus represents a straight line.

Since the projection of the entire three-dimensional line is known to be a straight line, there must be a reparametrization of the projected expression that converts it to the standard linear form. The projection is essentially a linear fractional transformation that can be equated to a linear form and solved for the inverse transformation. For the first component set

$x0 +T(x1 -x0) d-z0 -T(z1 -z0) =x0 d-z0 +t (x1 d-z1 -x0 d-z0)$

where the right-hand side comes from the parametrization connecting transformed endpoints. Keeping intact the bracketed quantity in the second term of the right-hand side, one easily finds

$T=t(d -z0) d-z1 +t(z1 -z0)$

The reparametrization depends only on higher-dimensional variables and so holds for both components of the projected line in two dimensions. This provides a direct connection between the apparently different forms of the projected line. The new parameter runs from zero to one as expected, just at a different rate along the line.

The entire development generalizes immediately to higher dimensions. For projecting a line in four dimensions onto a three-dimensional hyperplane, let the perspective point lie on the w-axis at a distance d from the origin. A line from the perspective point to any four-dimensional point can be parametrized as

$[0,0,0, d] +t [x,y,z, w-d]$

where the parameter t again runs from zero at the perspective point to one at the arbitrary point. If a three-dimensional xyz-hyperplane crosses the w-axis at a distance p from the origin, the line from the perspective point will intersect it when its w-coordinate equals p:

$d+t(w -d) =p → t=d-p d-w$

For this value of the parameter, the first two coordinates of the arbitrary point are

$[ d-p d-wx , d-p d-wy , d-p d-wy ]$

and this is the general formula for a perspective projection from four to three dimensions. The stereographic and orthogonal forms are found by the same choices of parameters as for the lower-dimensional cases.

Applying the general projection to a line between two arbitrary points, a parametrization of the line in four dimensions is

$[x0, y0, z0, w0] +t [x1 -x0, y1 -y0, z1 -z0, w1 -w0]$

Projection of the parametrization of the entire line now gives

$(d-p) [x0 +t(x1 -x0) d-w0 -t(w1 -w0), y0 +t(y1 -y0) d-w0 -t(w1 -w0), z0 +t(z1 -z0) d-w0 -t(w1 -w0) ]$

Just as before, this expression is tested for possible curvature by calculating a unit tangent vector for this vector function. The derivative of the vector function is

$d-p [d-w0 -t(w1 -w0) ]2 [(x1 -x0) (d-w0) +x0(w1 -w0), (y1 -y0) (d-w0) +y0(w1 -w0), (z1 -z0) (d-w0) +z0(w1 -w0) ]$

The dependence of this expression on the variable of parametrization is again separate from the individual vector components and will disappear when the vector is normalized. The unit tangent vector is again constant, the expression has no curvature and again represents a straight line.

The reparametrization variable is determined in the same way as for two dimensions:

$T=t(d -w0) d-w1 +t(w1 -w0)$

The reparametrization again depends only on higher-dimensional variables and holds for all components of the projected line in three dimensions.

The process of moving from three to four dimensions is essentially a renaming of variables. Clearly this extends to any number of higher dimensions. The general conclusion is that a straight line remains a straight line under perspective projection onto a hyperplane of one less dimension than the original space.

The import of this conclusion for visualizations is that one need only transform the vertices of higher-dimensional meshes and connect the resulting points with straight lines. There is no need to explicitly transform the mesh edges. This is what one does implicitly in working directly with transformed parametrizations of the higher-dimensional surface, but it is good to have a justification for the process.

Another reason to lay out the justification explicitly is that one encounters statements online to the effect that straight lines are not preserved by various perspective transformations, particularly stereographic projections. The confusion arises because many applications of projection involve a spherical surface, such as projections of the earth’s surface in map making. The development here concerns points in the ambient higher-dimensional space that are not restricted to any spherical surface and thus differs essentially from such applications.

In summary: perspective projection of a higher-dimensional object preserves straight lines.