  This paper introduces a combinatorial structure of orthogeodesics on
hyperbolic surfaces and presents several relations among them. As a primary
application, we propose a recursive method for computing the trace (the
hyperbolic cosine of the length) of orthogeodesics and establish the existence
of surfaces where the trace of each orthogeodesic is an integer. These surfaces
and their orthogeodesics are closely related to integral Apollonian circle
packings. Notably, we found a new type of root-flipping that transitions
between roots in different quadratic Diophantine equations of a certain type,
with Vieta root-flipping as a special case. Finally, we provide a combinatorial
proof of Basmajian's identity for hyperbolic surfaces, akin to Bowditch's
combinatorial proof of the McShane identity.
