How to draw a sphere. 3. The hyperbolic horizon

We want to draw a sphere. Actually, we want to draw an arbitrarily scaled and oriented ellipsoid. In part one I showed some matrix algebra for describing, transforming, and intersecting points, planes, and quadric surfaces (which include spheres). In part two I defined some useful coordinate systems and transformations. With the proper handling of hyperbolic silhouette curves the program works for any sphere (or ellipsoid) viewed from any point and in any direction. Making the algorithm work properly seems to be mostly a game of minus sign management since most of the tests hinge on the sign of some quantity. I've spent many hours chasing down rogue minus signs. The only thing left to discuss are some antialiasing tricks. >