使用香草数学:
var from:Point = new Point(100, 50); var to:Point = new Point(80, 95); var angle:Number = Math.atan2(to.y - from.y,to.x- from.x);
使用代表前两者之间差异的新向量:
var difference:Point = to.subtract(from); var angle:Number = Math.atan2(difference.y, difference.x);
注意:atan2()返回弧度,而不是度。