Calculate the R2 change of basis to transform two lines that intersect into two parallel lines perpendicular to x axis.
The idea is going from lines f and g to lines h and i. B is in f equivalent to E in h, D is in g equivalent to F in i.
I think Points A, C, H, G, J and I are important to construct the vectors of the change of basis.
Its a kind of rotation with scale transform. The intersection point between f and g should end up on the infinity.
I think a good solution could be to change the space to a higher dimension space like R4 or R5 with an ortonormal component to the plane xy. Calculate a basis, apply the change of basis and then proyect the higher space to xy plane. Using the points A, B, C and D filling z, v and w with 0's and an unitary vector for w axis.