how to construct a line on a poincare disk? Given the Euclidean coordinates of two points (p1, p2) and (q1, q2) in the unit circle, how do I construct the Euclidean circle x^2 + y^2 + fx + gy+1 representing the hyperbolic d-line on the poincare disk containing these points?
 A: 
A circle orthogonal to the unit circle through the points $P,Q$ must go through $P^{-1}$ and $Q^{-1}$, too, where $P^{-1},Q^{-1}$ are the circular inverses of $P$ and $Q$ with respect to the unit circle. That simply follows from the Tangent-Secant theorem.
Hence the hyperbolic line through $P=(x_1,y_1)$ and $Q=(x_2,y_2)$ is just an arc of the circle through $P,Q$ and 
$$P^{-1}=\left(\frac{x_1}{x_1^2+y_1^2},\frac{y_1}{x_1^2+y_1^2}\right).$$
A: The centres of circles that go through point $(p1, p2) $ and that are orthogonal to the unit circle
are on the line:
$$  y = \frac{p_1^2+ p_2^2 +1 -2 p_1 x }{2 p_2} $$
so the point you are looking for is on two such lines
the rest is algebra
Good luck
A: Let $P$ and $Q$ be the points. Tee "line" you want is a circle $C$ containing $P$ and $Q$ and perpendicular to the unit circle, meeting it at points $A$ and $B$. (Draw that picture for yourself, please). 
If $P$ and $Q$ lie on a diameter of the unit circle (i.e., if $PQ$ contains the origin), then the solution is the (euclidean) line $PQ$. Else:
Draw the perp. bisector of $P$ and $Q$. The center of the circle $C$ must lie on this bisector. For any point $X$ of the bisector that's outside the unit circle, you can draw a tangent to the circle through $X$; the length of this tangent varies with $X$. When this length is also the length of $XB$, say, then $X$ must be the center of the circle $C$ that you're seeking. 
Since all the stuff in the preceding paragraph can be converted to expressions linear in the coordinates of $P$ and $Q$ (for the bisector) or quadratic in $s$, the distance of $X$ from the midpoint $(P+Q)/2$, the problem now reduces to solving a quadratic in $s$. I'll leave that to you. (There are two solutions to the quadratic in general, but only one represents the center of circle $C$, so there may be a "solve and test" phase to this solution. 
