PointF2D.ts 472 B

12345678910111213141516171819
  1. export class PointF2D {
  2. public x: number = 0;
  3. public y: number = 0;
  4. constructor(x: number = 0, y: number = 0) {
  5. this.x = x;
  6. this.y = y;
  7. }
  8. public static get Empty(): PointF2D {
  9. return new PointF2D();
  10. }
  11. public static pointsAreEqual(p1: PointF2D, p2: PointF2D): boolean {
  12. return (p1.x === p2.x && p1.y === p2.y);
  13. }
  14. public ToString(): string {
  15. return "[" + this.x + ", " + this.y + "]";
  16. }
  17. }