In the July 1999 issue of PC Update we looked at the Hypercube, but the Hypersphere provides a quite different experience. Again, we will start off in 2D, but with the unit circle comprised of all points at unit distance from the origin. Mr Pytho Goras tells us that x squared plus y squared equals 1 (or 1 squared for those pedantic souls). Moving on to 3D, the unit sphere is again all points at unit distance from the origin and that clever gentleman can show that x^2 + y^2 + z^2 = 1. The sphere doesn't have convenient edges to draw so we will use great circles, like the equator or the longitudes, or perhaps others like the latitudes. Progressing to 4D, we can define the unit Hypersphere as all points meeting the equation u^2 + x^2 + y^2 + z^2 = 1. The real unit sphere is, of course, a special case where u = 0, and we could start by drawing circles on it, then proceed to rotate real axes with the unreal axis to move into the fourth dimension. We will only see the effects on the real co-ordinates and any point on the original surface can "lose" real values to the unreal co-ordinate, ending up anywhere inside the 3D sphere, i.e. every point in the (solid 3D) sphere is a point on the 3D hypersurface of the hypersphere. Plotting only the three real co-ordinates is effectively an orthogonal projection of a 4D point onto 3-space. Unreal rotations distort the circles to ellipses but they can never move beyond unit distance from the origin. For Figure 1, we treated all axes even-handedly by using the intersections with the planes of the six possible pairs of axes. Let us call them "equators". The three real pairs give circles but the three pairs involving the unreal axis initially give diameter lines since only the real axes co-ordinates can be plotted. Unreal rotations open up these lines to ellipses (while squashing down the real circles) as the unreal values are traded with real values. The figure is intriguing in that it is not the sort of arrangement you a likely to dream up thinking only in 3D. Note that there are eight points, which started off as ñ1 on each of the 4 axes, and which each have 3 ellipses (of the six) passing through them. The animated stereo program allows all rotations and the colourful results with screenclear off, but it was used to write a file for the POV-Ray tracing shown here, replacing lines with more substantial rings.
For the other Figures, we are going to desert the simple orthogonal projection and use a perspective projection in the fourth dimension to make the pictures more exciting (as was mentioned in the Hypercube article). In Figure 3, we can see that if we project from the point u = +1.05 on the u axis, onto the (3D) hyperplane u = 0, any point, such as P1, acquiring a high u value, say + 0.5, will seem close and all three of its x, y and z values on the picture hyperplane will be enlarged. Its diametrically opposite point on its circle, P2, will have a u value of -0.5 and its three real values will all seem about a third as big because it will seem further away (in 4D). This makes a circle bulge out on one side; in fact, it becomes an ellipse with one focus at the origin--no surprise to anyone familiar with conic projection. With Figure 2, we started on the real sphere only, with four latitudes, the equator and two longitudes at right angles at the poles; an unreal rotation of the x and u axes transferred some x values to u values giving the distortion seen in this raytracing. The leftmost points acquire positive u values at the expense of the x values so it bulges out from the centre due to the magnification of x, y and z by the 4D perspective. We also see it here as an object in true 3D perspective thanks to the raytracing process. It is not a particularly attractive shape but it does allow the unreal values of all points to affect the result. With a 3D sphere, we can take just one great circle and, with a rotation of 180 degrees about any axis in its plane, explore the whole surface, in the sense that every point can be swept over. Likewise, with the Hypersphere, we can use only one circle, but it would need an infinite number of real and unreal rotations to sweep every point on the 3D hypersurface. Still, we can simplify to one circle and immediately recomplicate it by rotating it, without clearing the screen, to see where it goes and to produce some shapes which are attractive. The program Listing 1 takes the form of a continuously running demo. A single great circle is cycled through rotations, of the three pairs of axes involving the unreal one, through a little more than 360 degrees to provides progressive phase shifts. The screen is only cleared for the start of each rotation mode, so we see the distorted circle drawn at 10-degree rotation intervals. As only one real co-ordinate changes in these rotations, an orthogonal projection would just produce elliptical tubes, but, with 4D perspective, the distortions of distance from centre give toroidal shapes which are pinched to various degrees at two diametrically opposite points. Figure 4 is a stereo pair for viewing with a mirror and you may note that the individual ellipses all encircle the hole, generating the elegant shape by a sort of rocking and rolling motion. Running the demo. will show shapes with all degrees of "pinching", from none to complete.
The 640x480 VGA screen mode is used as
we don't need EGA 2-page animation, used for the hypercube, but will be drawing on the visible screen. The
origin is placed in the centre of the right half where the figure will rotate and the left half can accept
the flipped left-eye view. We use 0, 1 and 2, which are easily cycled, for the variable "rotate" to choose
which mode of rotation occurs. The only keys recognised are "p" to pause and view a figure you want to
examine, or "Esc" to end it all.
HYPRSPHR.LZH will be on the Melb PC BBS, containing the .BAS and .EXE files for the programs used to produce all these figures. Reprinted from the August 1999 issue of PC Update, the magazine of Melbourne PC User Group, Australia |