# Distance from point to line segment in Poincaré disk model

I'm trying to build a geometric datastructure in hyperbolic space. For that purpose, I'm using the Poincaré disk model.

The distance between two points can be calculated with the hyperbolic law of cosines, as mentioned here.

As mentioned in the title, I'm interested in the distance between a point and a line segment. Let's say I have points $a$, $b$, and $c$. What is the distance between $c$ and the shortest path between $a$ and $b$?

With appropriate transformations, one could put $a$ in the origin and have the connecting path be a segment of the diameter. Would this make things easier?

• I see that a question about the Distance from a point to a line in the hyperbolic plane has been asked before. But I'm none too happy with the answers currently available there, which is probably mostly because the asker of that question didn't specify a model.
– MvG
Jun 26, 2014 at 16:55

## 1 Answer

I suggest you reflect the point in the hyperbolic line. This is just an inversion in a circle. Then you can compute the distance between the point and its image, and divide that by two.

Moving one of the points which span the line into the origin may help as well, but it's not immediately obvious. And quite an unsymmetric approach.

You might want to instead put the single point, $c$, in the origin. Then the line between $a$ and $b$ is a circle but the orthogonal line between $c$ and that is a diameter. So you'd have to find the point on the circle which is closest to the origin, which is a lot simpler. Then you are back to point-point distance.

• Thanks, this should work! I'll play with this idea for a bit and accept the answer when everything works. Jun 26, 2014 at 19:30
• This works, though I'm having trouble finding a good way for the coordinate transformation. Should I ask a new question for that? Jul 3, 2014 at 12:59
• @user155598: I'm not sure what transformation exactly you refer to, but I guess a new question for that would be best. Be sure to include a detailed description of how you represent hyperbolic lines, i.e. what numbers you use to describe them.
– MvG
Jul 3, 2014 at 13:06