•Pentagon example

In[63]:=

points = {{0, 0}, {1, 0}, {3/2, 1/2}, {-1/4, 1}, {-1/2, 1/4}} ; connect = {{1, 2, 3, 4, 5}} ;  pts = Part[points, connect[[1]]] ; areas = Apply[area, Partition[pts, 3, 1, {2}], {1}] ;

In[73]:=

convex[x, y] // Simplify

Out[73]=

{((7 + 12 x - 4 y) (-1 + x - y) (-13 + 4 x + 14 y))/(91 - 48 x^2 + 487 y + 198 y^2 + 2 x (64 + 33 y)), -((7 + 12 x - 4 y) (x + 2 y) (-13 + 4 x + 14 y))/(91 - 48 x^2 + 487 y + 198 y^2 + 2 x (64 + 33 y)), (18 (7 + 12 x - 4 y) y (x + 2 y))/(91 - 48 x^2 + 487 y + 198 y^2 + 2 x (64 + 33 y)), -(184 (-1 + x - y) y (x + 2 y))/(91 - 48 x^2 + 487 y + 198 y^2 + 2 x (64 + 33 y)), (28 (-1 + x - y) y (-13 + 4 x + 14 y))/(91 - 48 x^2 + 487 y + 198 y^2 + 2 x (64 + 33 y))}

•Compile function
•Show

In[71]:=

pent = Show[pContour,  Graphics[Flatten[{{RGBColor[1, 1, 1]}, {mask[pts]}}]], Graphics[Flatten[{{PointSize[.02]}, {outline[pts], name[pts], nodes[pts]}}]], PlotRange -> All, Frame -> False, AspectRatio -> 1, DisplayFunction -> $DisplayFunction]

[Graphics:../HTMLFiles/index_66.gif]

Out[71]=

-Graphics -


Converted by Mathematica  (March 7, 2003)