UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

23 lines (22 loc) 512 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Point = void 0; /** Represents a point in 2D space. */ class Point { x; y; constructor(x, y) { this.x = x; this.y = y; } static origin() { return new Point(0, 0); } distance(other) { return Math.sqrt((this.x - other.x) ** 2 + (this.y - other.y) ** 2); } isEqual(other) { return this.x === other.x && this.y === other.y; } } exports.Point = Point;