2
$\begingroup$

I have observed a strange behaviour with the following data for two lines and a point. Depending on the order in Graphics, Mathematica produces different geometric outputs. Does anybody know the reason for this?

x1 = {9.027522935779817, -3.0917431192660554};
x2 = {1, 18.21495327105389};
x3 = {2, 15.560747663572467};
x4 = {1, -6.116197183098593};
x5 = {2, -5.739436619718311};
one = Graphics[{Green, PointSize[0.03], InfiniteLine[{x4, x5}], 
   InfiniteLine[{x2, x3}], Point[x1]}]
two = Graphics[{PointSize[0.03], Point[x1],  InfiniteLine[{x4, x5}], 
   InfiniteLine[{x2, x3}]}]

output one output two

$\endgroup$
1
  • 2
    $\begingroup$ I think it has to do with how Graphics decides on the range based on the order of the objects to plot, similar to how Show uses the first plot to set some values. Try adding Axes->True to both cases. In the second case the range of the plot is much smaller because it is set relative to the point (I'm assuming). In the first case you are zoomed further out, so the point seems to lie on the intersection of the two lines. $\endgroup$
    – N.J.Evans
    May 5, 2021 at 18:30

1 Answer 1

1
$\begingroup$

Add the axes command to the second plot:

Graphics[{PointSize[0.03], Point[{x1}], InfiniteLine[{x4, x5}], 
  InfiniteLine[{x2, x3}]}, Axes -> True]

enter image description here

Watch the scale of the axes. Obviously Graphics chooses the region to plot so small that we see numerical errors of machine precision.

I think this should be reported to "[email protected]"

$\endgroup$
1
  • $\begingroup$ Great, thank you... this explains everything :) $\endgroup$ May 5, 2021 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.