Let $\xi\in\mathbb{R}$ and consider the average value (with respect to hyperbolic length) of the $j$-invariant ($j(z)=q^{-1}+744+196884q+\ldots$, $q=e^{2\pi iz}$) along a geodesic aimed at $\xi$: $$ \lim_{T\to\infty}\frac{1}{T}\int_0^Tj(\xi+e^{-t}i)dt. $$ This limit, when it exists, defines an $SL_2(\mathbb{Z})$-invariant function.

The only obvious (at least to me) values of $\xi$ for which the above limit exists are real quadratic numbers, where the path of integration is asymptotic to the geodesic (closed on the modular surface) joining $\xi$ with its Galois conjugate, i.e. the integrand is asymptotically periodic. For some numerical investigations in this case, see M. Kaneko http://www2.math.kyushu-u.ac.jp/~mkaneko/papers/43observations_j_values.pdf.

[One could also use some rational function of $j$ to measure how far from some set of points a geodesic trajectory is, a variation on http://www.math.ucla.edu/~wdduke/preprints/modularbilliards.pdf.]

However, it seems that the limit above could exist for some other badly approximable numbers (those irrational real numbers $\xi=[a_0;a_1,a_2,\ldots]$ whose continued fraction partial quotients $a_n$ are bounded, equivalently those $\xi$ for which the path $\{\xi+e^{-t}i : t\geq0\}$ is bounded on the modular surface).

I wondered whether this average had been investigated elsewhere, if there were reasons why it wouldn't exist for other badly approximable numbers, and whether or not it is interesting/tractable as a measure of approximation. At first glance it doesn't seem to carry any more information than the continued fraction expansion, but maybe there's some modular magic I don't understand floating around.