# how to check if a point is in a triangle

Problem: given a point r and a triangle defined by points ABC, tell if the point is inside or outside the triangle.

My C++ solution:

Why does this work?

I’m going to explain how I made this later because I am hungry at the moment. If you cannot wait, my solution has to do with this: barycentric_points.

Email me at nawatheyvarun (at) gmail (dot) com if you have questions.