I find myself reinventing the wheel pretty often when it comes to this, so I thought I would set it down here for the teeming masses of the future.
Sometimes I want a picture comprised of chords in the unit disk. One can draw them as straight line segments, but this has the disadvantage that short chords are almost indistinguishable from arcs of the circle. Hence, it makes more sense to draw Poincaré geodesics joining two points. As an example, below are two images depicting the same set of chords, once with Euclidean geodesics (straight lines) and once with Poincaré geodesics (arcs of circles). Notice how much more detailed (and, dare I say, pretty) the second picture appears.
The Poincaré geodesic joining two points
and
on the boundary of the unit circle is the unique circular arc that strikes the unit circle perpendicularly at
and
. It is not difficult to calculate what this geodesic is: the circle
that it lies on has a particular center and radius, and it subtends a particular set of angles from the center of
. I will not bother showing these calculations, but I will explain why this is not a good solution for the problem.
As the size of the geodesic gets smaller and smaller (i.e., as the points it connects gets closer and closer), the radius of the circle tends to zero, and such things are easy to draw. However, as the two points it’s connecting get further apart, the geodesic tends to a straight line, meaning that the circle’s radius gets large and the angles of intersection with the unit circle get really close together. This means that, when you ask your computer to draw them, you are not likely to get accurate pictures. Even worse, it will dump core all over you if you try to draw antipodal points. This course of action is highly recommended if you want strange errors from your postscript files.
The reasonable among you may ask, “Well, why don’t you stop drawing arcs of circles when the angle gets too big? Eventually they look like straight lines, so draw those, doofus.” Well, I’m not satisfied by that solution. I want to try something more complicated: Bézier curves!
To be more specific: a Bézier curve is a parametric curve which, in each coordinate, is a cubic polynomial. It has a knack for approximating smooth curves. In fact, it is relatively common to approximate a circle by four splines (see this page for more info), which is accurate to better than a tenth of a percent. My hope was that splines are better conditioned for drawing Poincaré geodesics than arcs of circles are.
The happy truth is that they are. Though I lack the time to go into the details, suppose you wish to draw a Poincaré geodesic between points
and
on the unit circle. According to the formulas on this page, there is a homeomorphism of the unit disk in the complex plane, given by

which sends Euclidean geodesics to Poincaré geodesics. In particular, the image of the straight line
under
is the Poincaré geodesic joining
and
. All you must do is find a spline
such that
and 
and
point toward the origin (i.e., are proportional to
and
, respectively),
- the spline passes through the image of the midpoint of
under
, and
- the spline is symmetric with respect to the perpendicular bisector of
.
These conditions give you that the endpoints of the spline are
and
, and the control points are
and
, where
is a function only of
. Specifically,

which, miracle of miracles, gracefully approaches
as
and
approach antipodal points.
This is now my go-to formula in any setting where Bézier curves are supplied for drawing Poincaré geodesics. I have not had the occasion to extend this to the approximation of a spline joining points
and
not on the unit circle, but it seems this would be straightforward.
As an example, here’s a short asymptote program which draws the chords specified in a text file in the unit disk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| /* chords-from-file.asy
* Author: Clinton Curry
* Date: April 24, 2009
*
* Draw the chords whose angles (in full revolutions) are given
* in the input file.
*/
size(400, 400);
draw(unitcircle );
// Read in a filename and open
file fin =input(stdin);
// Draw chords in file
real a,b;
while( !eof (fin ) ) {
a = fin;
b = fin;
pair z1 = (cos(2*pi *a ), sin(2*pi *a ));
pair z2 = (cos(2*pi *b ), sin(2*pi *b ));
real M = length(1/2 * (z1 +z2 ));
real kappa = 4/3* ( 1/(1+sqrt(1-M *M )) - 1/4);
draw(z1.. controls kappa *z1 and kappa *z2..z2 );
} |
admin Uncategorized mathematical illustration, mathematics, programming