判断点是否在线段或直线上
摘要:
var p:Point = new Point(10,15);var p1:Point = new Point(10,10);var p2:Point = new Point(10,20);trace(isPointOnSegment(p,p1,p2));function isPointOnSegment(p:Point,p1:Point,p2:Point):Boolean{ //差积是否为0,判断是否在同一直线上 //trace(( p1.x -p.x )*( p2.y-p.y) -( p2.x -p.x )*( p1.y-p.y)); if (( p1.x -p.x )*( p2.y-p. 阅读全文