Here is a very simple sketch that shows how to determine whether a point is inside a concave or convex polygon.

```
PVector[] p0 = new PVector[] { // Concave polygon
new PVector(80, 40), new PVector(60, 120), new PVector(120, 160),
new PVector(180, 60), new PVector(100, 110)
};
PVector[] p1 = new PVector[] { // Convex polygon
new PVector(240, 80), new PVector(260, 160), new PVector(330, 180),
new PVector(360, 60), new PVector(330, 40)
};
void setup() {
size(400, 200);
cursor(CROSS);
}
void draw() {
background(255);
drawPoly(p0);
drawPoly(p1);
}
void drawPoly(PVector[] verts) {
boolean inside = isInsidePolygon(verts, mouseX, mouseY);
if (inside) {
strokeWeight(6);
stroke(200, 0, 0);
} else {
strokeWeight(3);
stroke(0, 0, 200);
}
PVector prev = verts[verts.length - 1];
for (int i = 0; i < verts.length; i++) {
PVector curr = verts[i];
line(prev.x, prev.y, curr.x, curr.y);
prev = curr;
}
}
/**
* See if the given point is inside a polygon defined by the vertices provided.
*
* @param verts the vertices of the shape
* @param x0
* @param y0
* @return true if x0, y0 is inside polygon else returns false
*/
boolean isInsidePolygon(PVector[] verts, float x0, float y0) {
boolean oddNodes = false;
for (int i = 0, j = verts.length - 1; i < verts.length; j = i, i++) {
PVector vi = verts[i];
PVector vj = verts[j];
if ((vi.y < y0 && vj.y >= y0 || vj.y < y0 && vi.y >= y0) && (vi.x + (y0 - vi.y) / (vj.y - vi.y) * (vj.x - vi.x) < x0))
oddNodes = !oddNodes;
}
return oddNodes;
}
```