潸然泪下的小飞飞

导航

2015年3月5日 #

多边形切割折线

摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Security.Cryptography; 5 using System.Text; 6 using Sys... 阅读全文

posted @ 2015-03-05 16:29 潸然泪 阅读(544) 评论(0) 推荐(0) 编辑

判断线段是否有交点并求交点

摘要: 1 /*cug_1078判断线段是否有交点并求交点*/ 2 #include 3 #include 4 #include 5 6 const double eps = 1e-6; 7 8 typedef struct TPodouble 9 { 10 ... 阅读全文

posted @ 2015-03-05 16:26 潸然泪 阅读(1068) 评论(0) 推荐(0) 编辑

判断一个点是否在多边形内

摘要: 1 /* 2 fzu_1120 3 判断点q是否在多边形内的一种方法,过q作水平射线L, 4 如果L与多边形P的边界不相交,则q在P的外部。否则, 5 L和P的边界相交,具体地说,交点个数为奇(偶)数 6 时,点q在P的内(外)部。 */ 7 8 #include 9 #in... 阅读全文

posted @ 2015-03-05 16:25 潸然泪 阅读(712) 评论(0) 推荐(0) 编辑

求直线的交点

摘要: /*求直线的交点,注意平形的情况无解,避免RE*/TPoint LineInter(TLine l1, TLine l2){ //求两直线得交点坐标 TPoint tmp; double a1 = l1.a; double b1 = l1.b; double c1 =... 阅读全文

posted @ 2015-03-05 16:24 潸然泪 阅读(285) 评论(0) 推荐(0) 编辑

线段重叠+投影

摘要: 1 #include 2 #include 3 #include 4 5 #define eps 1e-8 6 #define pi acos(-1) 7 8 typedef struct SEG 9 { 10 double l, r; 11 }SEG; 12 ... 阅读全文

posted @ 2015-03-05 16:23 潸然泪 阅读(461) 评论(0) 推荐(0) 编辑

三角形外接圆+圆的参数方程

摘要: 1 //pku_1266_三角形外接圆+圆的参数方程.cpp 2 #include 3 #include 4 5 const double eps = 1e-6; 6 const double pi = acos(-1); 7 const double inf = 999999... 阅读全文

posted @ 2015-03-05 16:22 潸然泪 阅读(533) 评论(0) 推荐(0) 编辑

最小圆覆盖

摘要: 1 struct TPoint 2 { 3 double x, y; 4 TPoint operator-(TPoint &a) 5 { 6 TPoint p1; 7 p1.x = x - a.x; 8 p1.... 阅读全文

posted @ 2015-03-05 16:21 潸然泪 阅读(262) 评论(0) 推荐(1) 编辑