Geometry code gets tiresome after a while, but I want to finish this library, so here goes.
Basically, what’s the most efficient way to move one line segment, A, so that it no longer intersects with another, B?
Both line segments are defined with a start point (x, y) and a vector describing how the segment extends from that point (eX, eY). An example of how the line segment is described is below:

The solution I’m looking for is where the line segment is moved (its extent is not modified in any way) to the nearest location where it does not intersect. An example:

What is the most efficient way to get this result?
EDIT: People have asked what I mean by “move” – I mean change the (x, y) coordinate of the line segment start point. This will translate the entire segment.
And the line segments exist on the Cartesian plane, and any x/y movement is allowed.
How about this: find the four vectors: two from red line’s endpoints going perpendicularly to the black line, and two going perpendicularly from the red line to the black line’s endpoints. Take the shortest of these vectors and move the red line along it.