Instead of just deleting points in the triangle, we only check specific ones which are relevant
22 lines
414 B
C++
22 lines
414 B
C++
#include "Quickhull.h"
|
|
|
|
int main()
|
|
{
|
|
std::list<Point> points = {
|
|
Point(1, 1),
|
|
Point(-1, -1),
|
|
Point(-1, 1),
|
|
Point(1, -1),
|
|
Point(0.5, 0) // Should not be in the hull
|
|
};
|
|
std::list<Point> hull;
|
|
|
|
Quickhull::get_hull(points, hull);
|
|
|
|
for (const Point &point : hull)
|
|
{
|
|
std::cout << point.x() << ", " << point.y() << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
} |