1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.SPoint = void 0;
- var SPoint = (function () {
- function SPoint(x, y) {
- if (x == undefined) {
- this.x = 0;
- this.y = 0;
- }
- else if (x instanceof SPoint) {
- this.x = x.x;
- this.y = x.y;
- }
- else {
- this.x = x;
- this.y = y;
- }
- }
- SPoint.prototype.setPoint = function (x, y) {
- if (x instanceof SPoint) {
- this.x = x.x;
- this.y = x.y;
- }
- else {
- this.x = x;
- this.y = y;
- }
- };
- SPoint.prototype.manhattanLength = function () {
- return Math.abs(this.x) + Math.abs(this.y);
- };
- SPoint.prototype.matrixTransform = function (mat) {
- var p = new SPoint();
- p.x = this.x * mat.a + this.y * mat.b + mat.e;
- p.y = this.x * mat.c + this.y * mat.d + mat.f;
- return p;
- };
- SPoint.prototype.translate = function (dx, dy) {
- this.x += dx;
- this.y += dy;
- };
- return SPoint;
- }());
- exports.SPoint = SPoint;
|