判断点是否在多边形内
#include<iostream.h>
#include<math.h>
#include <vector>
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a<b)?a:b)
using namespace std;
const double INFINITY = 1e10;
const double ESP = 1e-5;
const int MAX_N = 1000;
//定义点
struct Point
{
double x, y;
};
//定义边
struct LineSegment
{
Point pt1, pt2;
};
typedef vector<Point> Polygon;
- 1
- 2
- 3
前往页