export class Vec2 { constructor( public readonly x: number, public readonly y: number, ) {} public distance_to(that: Vec2): number { return Math.sqrt((this.x - that.x) ** 2 + (this.y - that.y) ** 2); } public copy(): Vec2 { return new Vec2(this.x, this.y); } }