The algorithm is due to Gabriel Robins [1], a linear-time algorithm originally implemented in LISP for AI applications.
The original algorithm has been modified so that both X and Y planes are calculated simultaneously, increasing efficiency slightly. The basic code is only a page or so long.