In this paper, we present some generalizations of Lagrange's theorem in the
classical theory of continued fractions motivated by the geometric
interpretation of the classical theory in terms of closed geodesics on the
modular curve. As a result, for an extension $F/F'$ of number fields with rank
one relative unit group, we construct a geodesic multi-dimensional continued
fraction algorithm to "expand" any basis of $F$ over $\mathbb{Q}$, and prove
its periodicity. Furthermore, we show that the periods describe the relative
unit group. By developing the above argument adelically, we also obtain a
$p$-adelic continued fraction algorithm and its periodicity for imaginary
quadratic irrationals.Comment: 35 pages. This is the first draft of the article published in the
Journal of Number Theory. I will soon update the article with the accepted
manuscrip