As the fpc still does not accept arrays for inlining this function cannot be inlined.
You need mathematical solutions. Many of them have been made long ago.One of the oldest ways to determine if a point is inside of an irregular polygon, was to draw a line through that point and count intersection points between line and polygon (starting from the point towards outside of the polygon). If number of intersetion points was odd - then point is inside the polygon. If even - point is outside.
That is exactly what my shown code does.:D :P :D
That is exactly what my shown code does.