Polygon Intersection

Author

Eric W. Weisstein
December 10, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/ComputationalGeometry/PolygonIntersection.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PolygonIntersection.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Additional Authors

Imtek packages by Oliver Rübenkönig
available from http://www.imtek.de/simulation/

Initialization

<<Imtek`Geometry`Polygon`
<<Graphics`Colors`

ClosedLine[l_]:=Line[Append[l,First[l]]]

Usage

?ConvexIntersect

Example

p1={{2,0},{1,1},{0,0}};
p2={{1,1/2},{2,8/7},{0,8/7}};

q=Polygon[ConvexIntersect[{p1,p2}]]

Show[GraphicsArray[
Graphics[#,AspectRatio->Automatic]&/@{{{LightYellow,Polygon[p1]},ClosedLine/@{p1,p2}},
{{LightYellow,Polygon[p1]},{Yellow,q},
ClosedLine/@{p1,p2}}}
]
]