# Hyperbolic law of cosines

In hyperbolic geometry, the law of cosines is a pair of theorems relating the sides and angles of triangles on a hyperbolic plane, analogous to the planar law of cosines from plane trigonometry, or the spherical law of cosines in spherical trigonometry.

Take a hyperbolic plane whose Gaussian curvature is ${\displaystyle -{\frac {1}{k^{2}}}}$. Then given a hyperbolic triangle ABC with angles α, β, γ, and side lengths BC = a, AC = b, and AB = c, the following two rules hold:

${\displaystyle \cosh {\frac {a}{k}}=\cosh {\frac {b}{k}}\cosh {\frac {c}{k}}-\sinh {\frac {b}{k}}\sinh {\frac {c}{k}}\cos \alpha ,\,}$

considering the sides, while

${\displaystyle \cos \alpha =-\cos \beta \cos \gamma +\sin \beta \sin \gamma \cosh {\frac {a}{k}},\,}$

for the angles.

Christian Houzel (page 8) indicates that the hyperbolic law of cosines implies the angle of parallelism in the case of an ideal hyperbolic triangle:

When α = 0, that is when the vertex A is rejected to infinity and the sides BA and CA are parallel, the first member equals 1; let us suppose in addition that γ = π/2 so that cos γ = 0 and sin γ = 1. The angle at B takes a value β given by 1 = sin β cosh(a/k); this angle was later called angle of parallelism and Lobachevsky noted it by F(a) or Π(a).

## Hyperbolic law of Haversines

In cases where a/k is small, and being solved for, the numerical precision of the standard form of the hyperbolic law of cosines will drop due to rounding errors, for exactly the same reason it does in the Spherical law of cosines. The hyperbolic version of the law of haversines can prove useful in this case:

${\displaystyle \sinh ^{2}{\frac {a}{2k}}=\sinh ^{2}{\frac {b-c}{2k}}+\sinh {\frac {b}{k}}\sinh {\frac {c}{k}}\sin ^{2}{\frac {\alpha }{2}},\,}$