计算几何
YCQ_Lancet
骐骥一跃,不能十步,驽马十驾,功在不舍
展开
-
凸包模板
抄了一下kuangbin大神的模板ORZ#include#include#include#includeusing namespace std;const int MAXN=1000;struct point{ int x,y;};point list[MAXN];int stack[MAXN],top;int cross(point p0,point p1,po原创 2017-08-09 20:57:30 · 223 阅读 · 0 评论 -
TOYS POJ - 2318 计算几何
Calculate the number of toys that land in each bin of a partitioned toy box.Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave原创 2017-08-11 20:41:56 · 305 阅读 · 0 评论 -
Toy Storage POJ - 2398 计算几何
Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is rebellious an原创 2017-08-12 19:29:14 · 252 阅读 · 0 评论 -
Segments POJ - 3304 计算几何
Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least one point原创 2017-08-13 10:23:01 · 387 阅读 · 0 评论 -
Cows POJ - 3348 凸包面积
Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are forced to save money on buying fence posts by using原创 2017-08-15 09:30:54 · 353 阅读 · 0 评论 -
计算几何之相交直线交点的求法
假设交点为p0(x0,y0)。则有:(p1-p0)X(p2-p0)=0(p3-p0)X(p2-p0)=0展开后即是(y1-y2)x0+(x2-x1)y0+x1y2-x2y1=0(y3-y4)x0+(x4-x3)y0+x3y4-x4y3=0将x0,y0作为变量求解二元一次方程组。假设有二元一次方程组a1x+b1y+c1=0;a2x+b2y+c2=0那么x=原创 2017-08-15 10:45:46 · 5718 阅读 · 2 评论 -
快速排斥实验+跨立实验确定线段是否相交
如果两条线段短点相交,那么这个方法不可判断,只有跨立情况下才可以判断struct point{ int x,y;} p[M];int cross(point a0,point a1,point a2){ return (a1.x-a0.x)*(a2.y-a0.y)-(a1.y-a0.y)*(a2.x-a0.x);}bool judge(point s1,point原创 2017-08-14 11:18:06 · 495 阅读 · 0 评论