package Engine
{
	import flash.geom.Point;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author ...
	 */
	public class Functions
	{
		/**
		 * function AngbPoints(x0,y0,x1,y1:GLfloat):GLfloat;
var
  a:glfloat;
begin
  x1 := x1-x0;
  y1 := y1-y0;

  if(x1=0)then
  begin
    if y1>0 then a:=90;
    if y1<0 then a:=270;
  end else
  begin
    a := (y1/x1);
    a := abs(arctan(a))*(180/pi);
  end;

  if (x1<0)and(y1>0)then a:=180-a;
  if (x1<0)and(y1<0)then a:=180+a;
  if (x1>0)and(y1<0)then a:=360-a;

  Result := a;

end;
		 * @return
		 */
		public static function CalculateAngle(x0:Number, y0:Number, x1:Number, y1:Number):Number {
			var a:Number;
			
			x1 = x1 - x0;
			y1 = y1 - y0;
			
			if (x1 == 0) {
				if (y1 > 0) {
					a = 90;
				}
				if (y1 < 0) {
					a = 270;
				}
			}else {
				a = y1 / x1;
				a = Math.atan(a) * (180 / Math.PI);
			}
			
			return a;
		}
		
	}

}