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!

1 Like

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

2 Likes

does this work with any shape? It should right?

1 Like

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

2 Likes

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

1 Like