Minimum Distance between a Point and a Line
08 May 2013I haven’t published a blog post in quite a while! Whoops!
I have several in the works, one in particular comparing the JavaScript Engines Nashorn and Rhino that is near completion, and another one on something I’ve been doing with my Raspberry Pi.
For now here’s a short web page I put together showing how to work out the minimum distance between a point and a line based upon a solution posted on this website, which has some very useful formulas for working out problems in 2D and 3D space. I’ve only written an example for the first formula on this page, hopefully seeing it as an interactive visual representation might help anyone struggling with understanding how to find the minimum distance between a point and a line.
You can view the example here: http://lyndonarmitage.com/html/points_and_lines/
I’d suggest viewing it in a web browser that supports the range input type (Opera, Chrome, IE10) as it let’s you adjust the values more easily, although it works just as well in a browser that does not support the range input type yet.
Comments