摘要:
算法思想:利用向量叉积性质判断点和三角形边的相对位置关系。需要注意的是,在计算叉积之前需要先将三个顶点按顺时针或者逆时针方向排好序。叉积相关概念和性质参见:http://hi.baidu.com/zhubingn/item/cb63083e987b8cad134b14abhttp://en.wikipedia.org/wiki/Cross_product代码如下:#include <stdlib.h>#include <stdio.h>typedef struct _Point{ int x, y;}Point;void swap(Point *p1, Point *p 阅读全文
posted @ 2012-08-28 11:09
segeon
阅读(244)
评论(0)
推荐(0)

浙公网安备 33010602011771号