I am not sure this answers my question. The distance you minimize is always parallel to the y-axis. that is what you showed.
But I saw recently an example where people went from the points not parallel in y toward the slope from each point, but under an angle in comparison to y