# Determining a hyperbolic line from two points on Poincaré disk

I tried to make a C++ program to make a hyperbolic line.

This is how I started:

I have two points, $$P=(x_1, y_1)$$ and $$Q=(x_2, y_2)$$, in the Poincaré disk. And the radius is 1.

\begin{align} \alpha &= \frac{1}{x_1^2 + y_1^2} \qquad P^{-1} = (\alpha x_1, \alpha y_1) \\[4pt] \beta &= \frac{1}{x_2^2 + y_2^2} \qquad Q^{-1} = (\beta x_2, \beta y_2) \end{align}

Then calculate the center of the circle as the center of the two inverted points and the radius.

But the new circle does not intersect $$P$$ and $$Q$$.

What I doing wrong?

• I took the liberty of changing some notation to be more mathematical. If you have strong objections, you may reverse those changes.
– Blue
Mar 2, 2020 at 21:53
• Thank you! Sorry for my bad formatting. Mar 2, 2020 at 21:54
• The center of the target circle isn't "the center of the two inverted points". It's the center of the circle determined by (any three of) $P$, $Q$, $P^{-1}$, $Q^{-1}$. You can find this as the intersection of the perpendicular bisectors of two pairs of those points; you can standardize this by taking the pair $P$ and $P^{-1}$ and the pair $Q$ and $Q^{-1}$.
– Blue
Mar 2, 2020 at 22:07
• Thank you very much, it's worked. Mar 3, 2020 at 20:21
• You should post your working solution as an answer, so that this question won't get auto-reposted in the future. (Plus, we can upvote your success.)
– Blue
Mar 3, 2020 at 20:34