To find the shortest path from point O to lines AB and CD (in that order) one needs to consider three possibilities, namely projection from O to CD (if it intersects AB); projection on CD of the reflection of O thru AB (if it intersects AB); intersection of AB and CD.
Could you tell me how you get 2-nd answer(1.581139) Is it a distance from starting point to the lines intersrction? If it is, could you give me the coordinates of lines intersection? P.S. I got 1.597191412
I depend on obviouse statement: optimal path is some segment from (0,0) to one of lines and projection to another one. So I make full search about this situation. You think about line inersection as one of solutions of variational equation. But there are many other solutions.
How did you calculate the point of first move? I got 1.5811388 too, but first point is (0.849057,-1.22642), which lies on a line p:=((5,5),(-1,-4)). I searched such points with a help of finding a conditional extremal value of a function: F(x,y):=Dist((0,0),point)+Dist(point,q) (q is the second line), where point lies on p, and a function G(x,y):=Dist((0,0),point)+Dist(point,p), where point lies on q.