way 1
function DistanceTwoPoints(x1:Number, x2:Number, y1:Number, y2:Number):
Number {
var dx:Number = x1-x2;
var dy:Number = y1-y2;
return Math.sqrt(dx * dx + dy * dy);
}
way 2
var pt1:Point = new Point(circle1.x, circle1.y);
var pt2:Point = new Point(circle2.x, circle2.y);
var distance:Number = Point.distance(pt1, pt2);
AS3 distance between two points
2011年7月22日 星期五 by Hu, Ching-Hsiang
Filed under
as3
having
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言