clojure implementation of the line-sweep algorithm