UNPKG

vector2d

Version:

2D Vector library offering Float32Array, Array or standard Object based vectors.

52 lines 1.6 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var AbstractVector_1 = require("./AbstractVector"); /** * A vector representation that stores the axes as part of the instance itself * * ```ts * const v = new Vec2D.Vector(2, 5) * ``` */ var Vector = /** @class */ (function (_super) { __extends(Vector, _super); function Vector(x, y) { var _this = _super.call(this, Vector) || this; _this._x = x; _this._y = y; return _this; } Object.defineProperty(Vector.prototype, "x", { get: function () { return this._x; }, set: function (x) { this._x = x; }, enumerable: true, configurable: true }); Object.defineProperty(Vector.prototype, "y", { get: function () { return this._y; }, set: function (y) { this._y = y; }, enumerable: true, configurable: true }); return Vector; }(AbstractVector_1.AbstractVector)); exports.Vector = Vector; //# sourceMappingURL=Vector.js.map