It was introduced by David Hilbert (1895) as a generalization of Cayley's formula for the distance in the Cayley–Klein model of hyperbolic geometry, where the convex set is the n-dimensional open unit ball.
Let Ω be a convex open domain in a Euclidean space that does not contain a line.
If one of the points A and B lies on the boundary of Ω then d can be formally defined to be +∞, corresponding to a limiting case of the above formula when one of the denominators is zero.
A variant of this construction arises for a closed convex cone K in a Banach space V (possibly, infinite-dimensional).
on V. Given any vectors v and w in K \ {0}, one first defines The Hilbert pseudometric on K \ {0} is then defined by the formula It is invariant under the rescaling of v and w by positive constants and so descends to a metric on the space of rays of K, which is interpreted as the projectivization of K (in order for d to be finite, one needs to restrict to the interior of K).