Define a pentagon and a set of points. Then, determine which points lie inside (or on the edge) of the pentagon.

Define the x and y coordinates of polygon vertices to create a pentagon.

Define x and y coordinates of 250 random query points. Initialize the random-number generator to make the output of `randn`

repeatable.

Determine whether each point lies inside or on the edge of the polygon area. Also determine whether any of the points lie on the edge of the polygon area.

Determine the number of points lying inside or on the edge of the polygon area.

Determine the number of points lying on the edge of the polygon area.

Since there are no points lying on the edge of the polygon area, all 80 points identified by `xq(in)`

, `yq(in)`

are strictly inside the polygon area.

Determine the number of points lying outside the polygon area (not inside or on the edge).

Plot the polygon and the query points. Display the points inside the polygon with a red plus. Display the points outside the polygon with a blue circle.

Find the points inside a square with a square hole.

Define a square region with a square hole. Specify the vertices of the outer loop in a counterclockwise direction, and specify the vertices for the inner loop in a clockwise direction. Use `NaN`

to separate the coordinates for the outer and inner loops.

Define x and y coordinates of 500 random points. Initialize the random-number generator to make the output of `randn`

repeatable.

Determine whether each point lies inside or on the edge of the polygon area.

Plot the polygon and the query points. Display the points inside the polygon with a red plus. Display the points outside the polygon with a blue circle.

Query points in the square hole are outside the polygon.

Define the x and y coordinates for a pentagram.

Define the x and y coordinates of 12 query points.

Determine whether each point lies inside or on the edge of the polygon area. Also determine whether any of the points lie on the edge of the polygon area.

Determine the number of points lying inside or on the edge of the polygon area.

Determine the number of points lying on the edge of the polygon area.

Determine the number of points lying outside the polygon area (not inside or on the edge).

Plot the polygon and the points. Display the points strictly inside the polygon with a red plus. Display the points on the edge with a black asterisk. Display the points outside the polygon with a blue circle.

Six points lie inside the polygon. Two points lie on the edge of the polygon. Four points lie outside the polygon.