Reduce the Number of Points Defining a Curve http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm explains the Ramer-Douglas-Peucker algorithm for reducing the number of points in a curve that is approximated by a series of points. Use random numbers to generate a curve and then use the algorithm to reduce the number of points. You may use http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/ to draw the lines. You may use http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html to compute the distance from a point to a line. By dividing the points into groups one could use multiple cores to improve the running time (if we had a lot of points). Draw the original line and the final simplification.