Segments can be horizontal or vertical. I have the top point of the segment (if it is vertical) and left (if it is horizontal) and the length of the segment. How to find the shortest distance between them?
Segments (their number is 2) can be arranged as you like: both vertical; both horizontal; one horizontal, the other vertical; may intersect; may not intersect. Example of input data: 1) Horizontal, x = 100, y = 100, l = 50, 2) Vertical, x = 50, y = 250, l = 150;