2.1 lines: distance function

variation on how to join the dots: using a minimum distance function