Check if a point is inside of a triangle

Hi,
how can I check if a point is inside of a triangle? Is there a mathematical formula for it?
And what about any N sided shape?

And assuming this is true:
image

Thank you!

JeffreyThompson.org/collision-detection/tri-point.php

1 Like

does this work with any shape? It should right?

I didn’t test it, sorry. :confounded:

1 Like

It should. the only problem now is to sort the points to form a ring.