#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string.h> //poj2318
#include <queue> //几何运算(叉乘---判断是否在凸四边形内的判断(二分))
#define N 5010
using namespace std;
struct zuobiao
{
int x1, y1, x2, y2;
}p[N];
int b, c, a[N];
int check(int t) //叉乘的运算x1*y2-x2*y1(叉乘不满足交换律,所以可以判断其在左还是右)
{
int x1, y1;
x1=b-p[t].x2;
y1=c-p[t].y2;
return p[t].x1*y1-p[t].y1*x1;
}
int main()
{
int n, m, t, x1, y1, x2, y2, k, g, h, T=0;
while(1)
{
if(T)
printf("\n");
else T=1;
scanf("%d", &n);
if(!n)break;
scanf("%d%d%d%d%d", &m, &x1, &y1, &x2, &y2);
p[0].x1=0;
p[0].y1=y1;
p[0].x2=x1;
p[0].y2=y2;
for(t=1; t<=n; ++t)
{
scanf("%d%d", &p[t].x1, &p[t].x2);
p[t].y1=y1;
p[t].y2=y2;
p[t].x1=p[t].x1-p[t].x2;
p[t].y1=p[t].y1-p[t].y2;
}
memset(a, 0, sizeof(a));
for(t=0; t<m; ++t)
{
scan
几何运算(叉乘---判断是否在凸四边形内的判断(二分))
最新推荐文章于 2023-05-15 15:16:46 发布