Drawing lines on a Poincaré ball model

Dear all, hi again,

Is it possible to draw lines in a Poincaré ball model by Mathematica 6.0?
To draw a line on a Poincaré ball model, we need two point in the unit open ball, and such lines are circular arcs that pass through the given two points and intersect the boundary of the unit open ball orthogonally.

I have problems with the code above.
I want to explain my algorithm for drawing a gyroline to request some help about my mistake:
Let be the unit disc, and and be two points inside .
If the angle between and is , then the gyroline passing through the points and is the straight segment joining these two points.
If not, then we draw the orthogonal circle to , which passes through the given points and , and the gyroline is the shorter arc segment between and .
To draw the gyroline in this present case, I first calculate the center and the radius of the orthogonal circle , and then obtain the points and by transforming the points and by the transform vector , respectively, i.e., and .
Let denote the angle between the vectors and .
Then I draw a circle arc of radian length centered at the origin .
Now the problem is how much radians should I rotate the arc about the point to fix it between the points and .
My solution that I believed to be true was as follows:
Let be the rotation angle.
If (the transformed arc does not intersect the segment combining the points and ), then radians, where is the positive angle between the given vector and (the argument of the corresponding complex number).
Otherwise (when intersects the segment combining the points and ), .
But the code gives error while drawing the latter case.

Thanks.

Last edited by bkarpuz; March 21st 2009 at 03:10 PM.
Reason: The code is updated.

I have problems with the code above.
I want to explain my algorithm for drawing a gyroline to request some help about my mistake:
Let be the unit disc, and and be two points inside .
If the angle between and is , then the gyroline passing through the points and is the straight segment joining these two points.
If not, then we draw the orthogonal circle to , which passes through the given points and , and the gyroline is the shorter arc segment between and .
To draw the gyroline in this present case, I first calculate the center and the radius of the orthogonal circle , and then obtain the points and by transforming the points and by the transform vector , respectively, i.e., and .
Let denote the angle between the vectors and .
Then I draw a circle arc of radian length centered at the origin .
Now the problem is how much radians should I rotate the arc about the point to fix it between the points and .
My solution that I believed to be true was as follows:
Let be the rotation angle.
If (the transformed arc does not intersect the segment combining the points and ), then radians, where is the positive angle between the given vector and (the argument of the corresponding complex number).
Otherwise (when intersects the segment combining the points and ), .
But the code gives error while drawing the latter case.

Thanks.

Okay I got the solution.
In the latter case above, I rotate the points and by the angle around the origin , then consider the first case by increasing its rotation angle by .
The correct code is given below: