I shall assume line segment A is from x1,y1 to x2,y2
I shall assume line segment B is from x3,y3 to x4,y4
the length of segment B in the y direction is [y4-y3]
the length of segment B in the x direction is [x4-x3]
add these distances to the end point of segment A
A is now from x1,y1 to { x2+[x4-x3]},{y2+[y4-y3]}
Arthur