x^n + y^n + z^n = radius^n In the May PC Update (http://www.melbpc.org.au/pcupdate/9605/9605article8.htm), we saw what the Supercube looks like and I talked myself into exploring further shapes that the equation could produce. The first decision was to forsake ray-tracing, which can be very slow, or get into endless loops, with unusual objects involving concavities, saddle shapes, points of inflexion or thin sections. With convex objects, planes and spheres, you can make mathematical forays forward along the ray from the eye to quickly find the intersection with the closest surface and, by looking no further, hidden surfaces are conveniently ignored. The concave fractional supercubes are difficult, particularly when approaching a surface at a low angle or when near the razor edges where it is possible to pass right through between consecutive points and miss the object - the Swiss cheese effect. The nested supercubes were dumbly probed in forward steps of one pixel distance and rays passing right through would have been checked 480 times to see whether a surface was within that distance - potentially over 100 million points within the cube, fortunately halved since the average penetration would be about that. The published picture took about 15 minutes to calculate, on a 66 MHz 486. By calculating points on the surface and plotting directly, the figures opposite take a second or two. Surfaces heading off to infinity are no problem and the fundamental trisymmetry, if that's the word, helps. This means you only need to calculate points on a third of the surface and then circulate the three values around x/y/z to plot it all. Sometimes there is a further bisymmetry which only necessitates calculating for a sixth of the surface; then you also swap two of the values before again circulating around x/y/z. With even, positive or negative exponents the hex-symmetry occurs in all eight octants and one calculation serves for 48 points, although, of course, every point has to be processed for the double stereo plot. One disadvantage is that we can only plot surfaces as a mesh of points, in one colour to nullify the effect of hidden points appearing in front. The investigation resulted in an .EXE file, SUPERCUB.EXE [75 KB], it will display, on SVGA 800 x 600, all possible surfaces. A selection of the possibilities is shown here. To recapitulate: Provided an even, positive exponent is used, "exponentiated" coordinates x, y or z will always be positive even with negative coordinates and the equation will define a symmetrical surface which, as the exponent increases from 2 to infinity, swells from a sphere to become a cube. This has been called the supercube. I don't know whether the originator(s) of the notion included the further contrivances below in the definition; I would be interested to hear any evidence that my efforts are not original. The simple equation does invite further investigation; what if we use other than even integers? What about odd positive integers, and fractions, and negatives of all these? Raising negative coordinates to an odd integer power gives a negative result and we will not get a spherically symmetrical surface; and using a fractional exponent on a negative number isn't on - for example, raising -1 to the power of 0.5 (i.e. the square root of -1) gives the imaginary number, i, which is very useful in many branches of maths but isn't real.
One approach is to use only the absolute values of x, y and z so that we get, in the seven "negative" octants, mirror images of the surface in the all-positive octant and thus some nice symmetrical shapes. As the exponent is reduced from 2.0 down to +0, the sphere contracts, through an octahedron (at 1.0) and some sucked-in figures until it closely encloses the three axes between minus the "radius" and plus the "radius." Some of these shapes might inspire the sculptors among you; the spiky ones (Figure 1) might be a suitable station ID if you are starting your own TV empire - a bit sharper than the ABC Lissajous!
The odd negative integer exponents, in the all-positive octant only, give intermediate shapes (Figure 2, blue) similar to those from the bracketing even integers. But, in the three octants where one coordinate is negative, we see a startling shape (black); three corner pieces, asymptotic to the x/y/z = +radius planes, faired together, and coming to a point at the origin. In the three octants where two coordinates are negative, we have a third surface which is a rounded, infinite "corner" (red hatching), passing also through the origin and also asymptotic to the x/y/z = +radius planes (but in the other direction). The fillets contract for larger odd integers becoming sharp corners for minus odd infinity. The three surfaces are difficult to depict in a single picture and are more legible on screen, particularly when the whole range can be watched during plotting. |