vector.js 582 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.isVector = exports.Vector = void 0;
  4. var Vector = /** @class */ (function () {
  5. function Vector(x, y) {
  6. this.type = 0 /* VECTOR */;
  7. this.x = x;
  8. this.y = y;
  9. }
  10. Vector.prototype.add = function (deltaX, deltaY) {
  11. return new Vector(this.x + deltaX, this.y + deltaY);
  12. };
  13. return Vector;
  14. }());
  15. exports.Vector = Vector;
  16. var isVector = function (path) { return path.type === 0 /* VECTOR */; };
  17. exports.isVector = isVector;
  18. //# sourceMappingURL=vector.js.map