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. It can also be related to the relativistic velocity addition formula.
 Describing relations of hyperbolic geometry, Franz Taurinus showed in 1826 that the spherical law of cosines can be related to spheres of imaginary radius, thus he arrived at the hyperbolic law of cosines in the form:
   which was also shown by Nikolai Lobachevsky (1830):
   Ferdinand Minding gave it in relation to surfaces of constant negative curvature:
   as did Delfino Codazzi in 1857:
   The relation to relativity using rapidity was shown by Arnold Sommerfeld in 1909 and Vladimir Varićak in 1910.
 Take a hyperbolic plane whose Gaussian curvature is 
  
    
      
        −
        
          
            1
            
              k
              
                2
              
            
          
        
      
    
    {\textstyle -{\frac {1}{k^{2}}}}
  
. Given a hyperbolic triangle 
  
    
      
        A
        B
        C
      
    
    {\displaystyle ABC}
  
 with angles 
  
    
      
        α
        ,
        β
        ,
        γ
      
    
    {\displaystyle \alpha ,\beta ,\gamma }
  
 and side lengths 
  
    
      
        B
        C
        =
        a
      
    
    {\displaystyle BC=a}
  
, 
  
    
      
        A
        C
        =
        b
      
    
    {\displaystyle AC=b}
  
, and 
  
    
      
        A
        B
        =
        c
      
    
    {\displaystyle AB=c}
  
, the following two rules hold. The first is an analogue of Euclidean law of cosines, expressing the length of one side in terms of the other two and the angle between the latter:
         (1) The second law has no Euclidean analogue, since it expresses the fact that lengths of sides of a hyperbolic triangle are determined by the interior angles:
   Houzel indicates that the hyperbolic law of cosines implies the angle of parallelism in the case of an ideal hyperbolic triangle:
 When 
  
    
      
        α
        =
        0
        ,
      
    
    {\displaystyle \alpha =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
      
    
    {\displaystyle \gamma =\pi /2}
  
 so that 
  
    
      
        cos
        ⁡
        γ
        =
        0
      
    
    {\displaystyle \cos \gamma =0}
  
 and 
  
    
      
        sin
        ⁡
        γ
        =
        1.
      
    
    {\displaystyle \sin \gamma =1.}
  
 The angle at B takes a value β given by 
  
    
      
        1
        =
        sin
        ⁡
        β
        cosh
        ⁡
        (
        a
        
          /
        
        k
        )
        ;
      
    
    {\displaystyle 1=\sin \beta \cosh(a/k);}
  
 this angle was later called "angle of parallelism" and Lobachevsky noted it by "F(a)" or "Π(a)". In cases where 
  
    
      
        a
        
          /
        
        k
      
    
    {\displaystyle 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:
   Setting 
  
    
      
        
          [
          
            
              
                
                  a
                  k
                
              
            
            ,
             
            
              
                
                  b
                  k
                
              
            
            ,
             
            
              
                
                  c
                  k
                
              
            
          
          ]
        
        =
        
          [
          
            ξ
            ,
             
            η
            ,
             
            ζ
          
          ]
        
      
    
    {\displaystyle \left[{\tfrac {a}{k}},\ {\tfrac {b}{k}},\ {\tfrac {c}{k}}\right]=\left[\xi ,\ \eta ,\ \zeta \right]}
  
 in (1), and by using hyperbolic identities in terms of the hyperbolic tangent, the hyperbolic law of cosines can be written:
         (2) In comparison, the velocity addition formulas of special relativity for the x and y-directions as well as under an arbitrary angle 
  
    
      
        α
      
    
    {\displaystyle \alpha }
  
, where v is the relative velocity between two inertial frames, u the velocity of another object or frame, and c the speed of light, is given by
   It turns out that this result corresponds to the hyperbolic law of cosines - by identifying 
  
    
      
        
          [
          
            ξ
            ,
             
            η
            ,
             
            ζ
          
          ]
        
      
    
    {\displaystyle \left[\xi ,\ \eta ,\ \zeta \right]}
  
 with relativistic rapidities 
  
    
      
        
          
            
              (
              
                
                  [
                  
                    
                      
                        U
                        c
                      
                    
                    ,
                     
                    
                      
                        v
                        c
                      
                    
                    ,
                     
                    
                      
                        u
                        c
                      
                    
                  
                  ]
                
                =
                
                  [
                  
                    tanh
                    ⁡
                    ξ
                    ,
                     
                    tanh
                    ⁡
                    η
                    ,
                     
                    tanh
                    ⁡
                    ζ
                  
                  ]
                
              
              )
            
          
        
        ,
      
    
    {\displaystyle {\scriptstyle \left(\left[{\frac {U}{c}},\ {\frac {v}{c}},\ {\frac {u}{c}}\right]=\left[\tanh \xi ,\ \tanh \eta ,\ \tanh \zeta \right]\right)},}
  
 the equations in (2) assume the form: