mirror of
https://github.com/photonstorm/phaser
synced 2024-12-04 18:40:59 +00:00
19 lines
457 B
JavaScript
19 lines
457 B
JavaScript
var Shapes;
|
|
(function (Shapes) {
|
|
|
|
var Point = Shapes.Point = (function () {
|
|
function Point(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
Point.prototype.getDist = function () {
|
|
return Math.sqrt((this.x * this.x) + (this.y * this.y));
|
|
};
|
|
Point.origin = new Point(0, 0);
|
|
return Point;
|
|
})();
|
|
|
|
})(Shapes || (Shapes = {}));
|
|
|
|
var p = new Shapes.Point(3, 4);
|
|
var dist = p.getDist();
|