Templated convex_hull function in Geometry.cpp

This commit is contained in:
Lukas Matena
2018-08-17 15:20:35 +02:00
parent 3f72ca2a15
commit 48b9793d3d
4 changed files with 43 additions and 19 deletions

View File

@@ -263,6 +263,12 @@ operator<<(std::ostream &stm, const Pointf &pointf)
return stm << pointf.x << "," << pointf.y;
}
double
Pointf::ccw(const Pointf &p1, const Pointf &p2) const
{
return (double)(p2.x - p1.x)*(double)(this->y - p1.y) - (double)(p2.y - p1.y)*(double)(this->x - p1.x);
}
std::string
Pointf::wkt() const
{