An Introduction to Coordinate Geometry via Three-Dimensional Visualisation
I did research in Astrophysics for a few years, essentially mapping the large-scale structure of the Universe, identifying the largest known structures in the cosmos. I designed an algorithm to do the job, but what it gave me was piles and piles of data, not pretty pictures. So about half a year before my thesis was due I got to wondering what all these structures looked like in three dimensions (instead of writing the thesis because who does that so early?). So I wrote a bunch of scripts to find out, posting the resultant animations of groups, clusters, filaments and voids at this page.

So those look pretty cool, or so I like to think. But how did I do it? You'll be interested to know that it was all coordinate geometry, really. Basically I spent a whole day thinking back to my high school classes, working out how to produce the frames that I would put together to create animated spins of the structures that I had found. And then another day writing it all in code. But the code isn't the story here, we'll focus on the mathematics involved.

To create an animation of anythng, we first need to produce still frames, and in this case I needed each frame to show the structure from a specific angle. For each of these frames, we need to project the three-dimensional positions of the parts of each structure onto a viewing plane. Then we need to rotate the structure (or equivalently, revolve our camera) by some regular angular increment, and for a nice touch to enforce the three-dimensional feel of the animation, put it all in a box. You would have already seen the completed animations that I linked to above, but here's a basic "skeletal" example, of the solid-particle-render variety.

Two things to note in particular are that:

  • The sides of the cube are dotted lines. This is to highlight how they are constructed: I actually made those "lines" out of many particles, they are not single objects. To do this economically, for each line I specified two endpoints (so technically these are intervals and not lines), and an interparticle separation. The mathematics of this is ratio division, by which the position of each individual position along an interval can be determined by the ratio of the distances from the endpoints.
  • There is one purple solid particle, rendered as a Gaussian blur, in the centre of the cube. As the cube rotates, you will see that it obscures one side (the "far side") of the cube at a time, creating the illusion of depth. How do we do this? Essentially, we need to distinguish background (the obscured side of the cube) and foreground (the solid particle) objects, and the geometric quantity we need for this is distance. Specifically, the distance between the camera and the particle to be rendered.

Here's another skeletal example:

What we've changed here is that the angle of elevation of the camera's revolution is closer to one of the "poles". To achieve this, we need to put the camera at the correct "height", and there is a relation between angle and gradient that we need here.

So what we have seen is that in three-dimensional modelling, coordinate geometry is essential. I myself used it to to create lines (intervals), distinguish background and foreground objects and relate angles to horizontal and vertical displacements. Below I reprise some finished products - both show the scale of homogeneity, a scale at which the Universe is thought to be homogeneous.

A solid particle render:

An isosurface, which is a different mode of visualisation to what we have looked at above, but the same principles still apply: