I'm trying to detect every coordinates possible for my polygon. (it's not everytime a triangle, it's for that).But when i'm trying to check every x & y possible, my program is not working at all.
Here is my program
int main()
{
int x = 0;
int y = 0;
typedef boost::geometry::model::d2::point_xy<double> point_type;
boost::geometry::model::polygon<point_type> poly2;
boost::geometry::read_wkt("POLYGON((375 200,700 900,1100 190))", poly2);
for (x = 0; x < 1200; x++)
{
if (x > 1150)
{
x = 0;
y++;
}
else if (y > 1000)
exit(0);
else
{
point_type p(x, y);
bool check_covered = boost::geometry::within(p, poly2);
if (check_covered)
{
std::cout << "in" << std::endl;
}
}
}
return 0;
}
But i don't have output. Basically, they're never entering in my "if (check_covered)"
I don't understand why. When i'm using a draw to check if the polygon is working,
i have my triangle
