Given two 2D line segments, A and B, how do I calculate the length of the shortest 2D line segment, C, which connects A and B?
This page has a nice short description for finding the shortest distance between two lines, although @strager's link includes some code (in Fortran!)