var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/**
* @module annie
*/
var annie;
(function (annie) {
/**
* @class annie.Point
* @extends annie.AObject
* @since 1.0.0
* @public
*/
var Point = (function (_super) {
__extends(Point, _super);
/**
* 构造函数
* @method Point
* @public
* @since 1.0.0
* @param x
* @param y
*/
function Point(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
_super.call(this);
/**
* 水平坐标
* @property x
* @public
* @since 1.0.0
* @type{number}
*/
this.x = 0;
/**
* 垂直坐标
* @property y
* @since 1.0.0
* @public
* @type {number}
*/
this.y = 0;
var s = this;
s._instanceType = "annie.Point";
s.x = x;
s.y = y;
}
Point.prototype.destroy = function () { };
/**
* 求两点之间的距离
* @method distance
* @param args 可变参数 传两个参数的话就是两个annie.Point类型 传四个参数的话分别是两个点的x y x y
* @return {number}
* @static
*/
Point.distance = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
var len = args.length;
if (len == 4) {
return Math.sqrt((args[0] - args[2]) * (args[0] - args[2]) + (args[1] - args[3]) * (args[1] - args[3]));
}
else if (len == 2) {
return Math.sqrt((args[0].x - args[1].x) * (args[0].x - args[1].x) + (args[0].y - args[1].y) * (args[0].y - args[1].y));
}
};
return Point;
}(annie.AObject));
annie.Point = Point;
})(annie || (annie = {}));