1
$\begingroup$

I seem to get slightly different result when intersecting line segments vs interesting (infinite) lines.

RegionIntersection[Line[{{0, 0}, {2, 2}}], Line[{{0, 2}, {2, 0}}]]

results in

Point[{{1, 1}}]

while

RegionIntersection[InfiniteLine[{{0, 0}, {2, 2}}], InfiniteLine[{{0, 2}, {2, 0}}]]

results in

Point[{1, 1}]
$\endgroup$
2
  • 6
    $\begingroup$ It’s probably because 2 infinite lines can only intersect at one point, while two Line objects can intersect at multiple points $\endgroup$
    – Carl Woll
    Commented May 4, 2019 at 2:55
  • $\begingroup$ @CarlWoll I think you should add this as an answer :) $\endgroup$
    – Carl Lange
    Commented May 4, 2019 at 7:20

1 Answer 1

2
$\begingroup$

Following on from the Carls' comments that infinite lines can only intersect at one point, while two Line objects can intersect at multiple points.

We see that

RegionIntersection[Line[{{0, 0}, {2, 2}, {3, 3}}], Line[{{0, 2}, {2, 0}, {3, 3}}]]

indeed returns

Point[{{1, 1}, {3, 3}}]

So Line represents a Polygonal Chain rather than a Line Segment

$\endgroup$

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.