Skip to main content
added 74 characters in body
Source Link
hana
  • 2.6k
  • 6
  • 19

Why does the first one return EmptyRegion[2] while the second one works? I expected the result is Line[{{0, 0}, {1, 1}}] as the second one.

RegionIntersection[
 Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

RegionIntersection[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

Aslo how does EmptyRegion is defined? I read the docs but still not quite clear. It seems like a point is not empty in R but empty in R2.

How would I define a polygon region like above but without the boundary?

Why does the first one return EmptyRegion[2] while the second one works? I expected the result is Line[{{0, 0}, {1, 1}}] as the second one.

RegionIntersection[
 Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

RegionIntersection[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

Aslo how does EmptyRegion is defined? I read the docs but still not quite clear. It seems like a point is not empty in R but empty in R2.

Why does the first one return EmptyRegion[2] while the second one works? I expected the result is Line[{{0, 0}, {1, 1}}] as the second one.

RegionIntersection[
 Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

RegionIntersection[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

Aslo how does EmptyRegion is defined? I read the docs but still not quite clear. It seems like a point is not empty in R but empty in R2.

How would I define a polygon region like above but without the boundary?

Source Link
hana
  • 2.6k
  • 6
  • 19

Why does this RegionIntersection return EmptyRegion?

Why does the first one return EmptyRegion[2] while the second one works? I expected the result is Line[{{0, 0}, {1, 1}}] as the second one.

RegionIntersection[
 Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}, {-1, 1}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

RegionIntersection[Polygon[{{-1, 1}, {1, 1}, {1, 0}, {-1, 0}}], 
 Line[{{0, 0}, {1, 1}}]]

enter image description here

Aslo how does EmptyRegion is defined? I read the docs but still not quite clear. It seems like a point is not empty in R but empty in R2.