Skip to main content
2 of 4
added 765 characters in body
glS
  • 7.8k
  • 1
  • 26
  • 66

More an observation than an answer (I post it here because I cannot put figures in comments). The behaviour seems to be caused by the Dashed attribute.

Op's code for me (v11.0.1 x64 on Windows 10) produces

point1 = {57.7538, 44.0056}; point2 = {57.7607, 43.9983}; line1 = Line[{point1, point2}]; line2 = Line[{{54.3101, 40.715}, {58.4058, 44.624}}]; intersectionPoint = First[{x, y} /. FindInstance[{x, y} \[Element] line1 && {x, y} \[Element] line2, {x, y}]]; Graphics[{ {Gray, line1}, {PointSize[Large], Point[{point1, point2}]}, {PointSize[Large], Red, Point[intersectionPoint]} }, Prolog -> {Dashed, line2}, Frame -> True, ImageSize -> Large ] 

Removing the Dashed attribute in the Prolog option, I get:

point1 = {57.7538, 44.0056}; point2 = {57.7607, 43.9983}; line1 = Line[{point1, point2}]; line2 = Line[{{54.3101, 40.715}, {58.4058, 44.624}}]; intersectionPoint = First[{x, y} /. FindInstance[{x, y} \[Element] line1 && {x, y} \[Element] line2, {x, y}]]; Graphics[{ {Gray, line1}, {PointSize[Large], Point[{point1, point2}]}, {PointSize[Large], Red, Point[intersectionPoint]} }, Prolog -> {line2}, Frame -> True, ImageSize -> Large ] 

Drawing line2 inside the same Graphics as the rest of the objects doesn't change this, so it doesn't look like a problem in Prolog.

Even better, the lower the Dashing, the further away the line is drawn from the intersection point:

point1 = {57.7538, 44.0056}; point2 = {57.7607, 43.9983}; line1 = Line[{point1, point2}]; line2 = Line[{{54.3101, 40.715}, {58.4058, 44.624}}]; intersectionPoint = First[{x, y} /. FindInstance[{x, y} \[Element] line1 && {x, y} \[Element] line2, {x, y}]]; Graphics[{ {Gray, line1}, {PointSize[Large], Point[{point1, point2}]}, {PointSize[Large], Red, Point[intersectionPoint]} }, Prolog -> Map[{Hue[10 #], Dashing@#, line2} &]@Range[0, .5, 0.01], Frame -> True, ImageSize -> Large ] 

I have no idea why this happens.

glS
  • 7.8k
  • 1
  • 26
  • 66