# Average distance from a line to a point

We will generate a random line in the hyperbolic plane. Working in the Poincaré disk model, choose to random points on boundary of the disk. These will correspond to Ideal points in the hyperbolic plane. We can then draw a line between the points, forming a line in the hyperbolic plane.

(Sidenote: This probability distribution is not absolute, but rather depends on which point you choose as the center of the Poincaré disk model.)

What is the expected value of the distance between this line, and the point corresponding to the center of the disk (assuming the curvature is $-1$)?

(By distance, I mean the length (in the hyperbolic plane) of the line segment connecting the line and point, such that the line segment is perpendicular to the line.)

Cool question. If I didn't make a mistake, I get an expected hyperbolic distance of 1.99628. If I did make a mistake, hopefully this will still help.

Consider the two lines through the origin that share the ideal endpoints of the random line. This defines a sector in the disk models. Picking the random hyperbolic line as you describe therefore corresponds to picking a random sector in a circle. If all ideal points are equally likely to get picked (circular uniform distribution), the distribution of random sectors is also uniform. Any sector is equally likely to be picked.

Work in the Klein model. Due to symmetry, the first point can be taken as (1,0), and the sector defined by the angle $\theta$. With simple trig, we can relate the sector angle to the hyperbolic distance from the origin to the line.

$cos(\frac{\theta}{2})=\frac{1}{2}ln( \frac{1+d}{1-d} )$

or, solving for d:

$d=f(\theta)=\frac{e^{2cos(\frac{\theta}{2})}-1}{e^{2cos(\frac{\theta}{2})}+1}$

To get the expected value, we need to calculate the integral:

$\int_{0}^{\pi} \theta f(\theta) d\theta$

(Again, because of symmetry, we only need to go to $\pi$.) Wolfram Alpha calculates this definite integral to be 1.99628.