Drawing a Line on a Digital Display
Lines at an angle have to be approximated on a digital display by picking a certain sequence of pixels to turn on. The optimal choice has a structure that depends on issues in number theory. Antialiasing can be done by grouping neighboring pixels and weighing them by the distances from the actual line.
Rational slopes lead to repeating patterns; square roots and other quadratic irrationals lead to nested patterns.