/point-within-triangle-test

This repository implements three methods for checking whether a point is within a triangle

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Point within triangle test

This repository implements in C++, all the methods discussed in this blog , for checking whether a point is within a triangle. The application draws on the screen the triangle, the containing points and the points that are not enclosed in the triangle with different colors. A sample input file is provided (points.txt) that contains 2D points to check whether each one is within a triangle. The triangle is hardcoded into the source code.

Project Requirements

  1. C++11
  2. CMake
  3. OpenCV

Install OpenCV

sudo apt-get install libopencv-dev python-opencv

How to run on Linux

git clone https://github.com/gevago01/point-within-triangle-test.git
cd point-within-triangle-test
mkdir build
cd build
cmake ..
make
./PointInTriangle