While messing with another project I realized I needed point-line collision detection. I came across this for how to do it: http://funplosion.com/devblog/collision-detection-line-vs-point-circle-and-rectangle.html After trying to figure out how that algorithm works, I realized it was using vector projection (http://en.wikipedia.org/wiki/Vector_projection) to figure out what was the closest point on the line.
To test things out I put together a little demo program: http://ea115.posterous.com/. There are lines and balls that bounce around the screen and it uses the above algorithm to figure out how close each ball is to any of the lines. If its close enough it’ll draw a line from the ball to the closest point on that given line. The color of that line depends on how close the ball is to it. The end result is pretty cool looking I thought. More lines and balls looks cooler, although it’s probably easier to understand what’s going on with less.