How to determine whether a point lies inside of a triangle or on the edge efficiently, if possible with constant time. WITH NO DOUBLE PRECISION
Context:
- The plane is two dimensional
- Triangle is set according to three coordinate pairs
Coord(int x, int y)
- The bounds for coordinates are: [-2,000,000 , 2,000,000 ]
- Triangle coordinates are assumed to be a valid triangle mesh
- Test point is also an integer.
Visual example: Image link
Format example:
Triangle a(Coord(50000,50000),Coord(-4000,2000), Coord(300000,150000));
// Point Result
a.test_point( 60000, 45000) // G true
a.test_point( 289500, 145500) // F true
a.test_point( 292000, 146000) // E false
a.test_point(-292000,-146000) //-E false
a.test_point( 260000, 134000) // D true