flex算两线交点

时间:2019-03-16 06:10:26
【文件属性】:

文件名称:flex算两线交点

文件大小:2KB

文件格式:TXT

更新时间:2019-03-16 06:10:26

flex两线交点

flex算两线交点 ExampleApplication1=new ExampleApplication(); // ExampleApplication1.showMessage( ); graphics.lineStyle(1, Math.random( ) * 0xffffff, 1); graphics.moveTo(Math.random( ) * 400, Math.random( ) * 400); graphics.lineTo(Math.random( ) * 400, Math.random( ) * 400); //Alert.show(intersection( a, b, c, d ).toString() ); // 输出 : (x=80, y=80) } public static function intersection( a:Object, b:Object, c:Object, d:Object ):Point { var pos1 = (b.y-a.y)/(b.x-a.x); var pos2 = (d.y-c.y)/(d.x-c.x); var pi = Number.POSITIVE_INFINITY; var ni = Number.NEGATIVE_INFINITY; if(pos1==pos2){ return null; }


网友评论