JMU is hosting an REU program this summer in computer science. Sarah Ciresi, a rising senior at Georgetown, is working on a project to develop a low-cost 3D scanner for capturing soap bubble configurations. You can follow her progress here.

To aid her work, we’ve been developing a library for inversive geometry on which is (heavily) based on the structure formulated in Sharif Ghali’s excellent book Introduction to Geometric Computing. The goal is to make our library public at the end of the summer.

Ghali covers a lot in his book, including the development of some spherical geometry (though his “circles” are really only the “great circles”), and an implementation of *the oriented projective space* as formulated in Jorge Stolfi’s PhD thesis and subsequent book. This oriented projective space is really the space of rays in .

In this post we assume some familiarity with homogeneous coordinates of points in and their representation in . Readers unfamiliar with these should check out “Introduction to Geometric Computing” for a very well thought out introduction. (Perhaps we’ll post a video on this sometime.)

**R**epresenting disks on the sphere

For our purposes, we needed more spherical geometry than Ghali’s introduction provides. Specifically, we work with circles on which are not necessarily great circles, and we also need our circles to be *oriented*, meaning that there is a given direction along the circle that is treated as *counter-clockwise*. Another picture of this is that instead of oriented circles, we are dealing with *disks*, which are the oriented circles along with the region bounded on the left of the circle (where “left” is defined with respect to the circle’s counter-clockwise orientation).

Now, notice that any circle on the sphere can be represented by the plane whose intersection with is . This, in turn, is the intersection of the hyperplane in with 3D unit sphere in the the level sub-space. (If it seems like we just jumped into 4-dimensions out of nowhere, don’t worry, it will make sense in a minute.) Thus, we give coordinates to a circle on by specifying the 4-tuple of coefficients of the hyperplane . Notice that multiplying all the coefficients by any fixed does not change the circle represented since .

To obtain disks from such a representation, we adopt the convention of Stolfi and treat and as the same disk if and only if . Our convention is to identify the disk incident to with area less than with those 4-tuples where and those with area greater than with those 4-tuples where . ( is a great circle, and then the direction of the 3-vector is used to identify the disk.)

One of the nice things about this representation, is that several computations become trivial. In the following let represent a disk with boundary For instance:

- The
*Euclidean center*of (i.e. the center in Euclidean 3-space, not on the sphere ) is given by the homogeneous coordinates , (the 3D point where ). - The
*spherical center*of is where is defined as above. - The
*Conical cap of*, which is the apex of the cone tangent to at is given by the homogeneous coordinates . If , then this corresponds to the 3D point , and if , this corresponds to the point at infinite at the endpoint of the ray . (For the uninitiated, this is the power of the homogeneous coordinates–we can represent points at infinity as if they are any other point. But that is a matter for another post.)

## The Inversive Distance

One of the main functions we work with in inversive geometry is the inversive distance between two circles. The usual way of defining this for circles on the sphere is:

where is the spherical center of and is its spherical radius (for ) and is the spherical angle between and .

Given our representation of circles as the 4-tuples and , the inversive distance becomes

which is simply the between the vectors and under the (3,1) Minkowski inner product.

In other words, circles on the sphere endowed with the inversive distance are a geometric picture of vectors in space-time endowed with the usual Minkowski inner product!