typedef struct Point
{
int x;
int y;
Point(int x,int y)
{
this->x = x;
this->y = y;
}
}Point;
inline float GetCross(Point const& p1, Point const& p2, Point const& p)
{
return (p2.x - p1.x) * (p.y - p1.y) - (p.x - p1.x) * (p2.y - p1.y);
}
bool IsPointInMatrix(Point const& p, std::Vector const &vPointsList)
{
Point p1 = vPointsList[0];
Point p2 = vPointsList[1];
Point p3 = vPointsList[2];
Point p4 = vPointsList[3];
return GetCross(p1, p2, p) * GetCross(p3, p4, p) > 0 && GetCross(p2, p3, p) * GetCross(p4, p1, p) > 0;
}