On the flat torus T² = ℝ²/ℤ², a geodesic is a straight line with periodic boundary conditions.
If slope dy/dx = p/q is rational, the orbit is periodic (closes after q horizontal wraps).
If irrational, the orbit is dense and equidistributed (Weyl's theorem 1916).
Left: torus (wrap-around). Right: unfolded trajectory in the plane.
Click the torus to set start position.