import { comparePointsXFirst } from '../../utils/compare';
import { distPP } from './point';
// A segment line wrapper used for creation Dictionary of pairs of points
export class PointPair {
    constructor(first, second) {
        if (comparePointsXFirst(first, second) < 0) {
            this.first = first;
            this.second = second;
        }
        else {
            this.first = second;
            this.second = first;
        }
    }
    get First() {
        return this.first;
    }
    get Second() {
        return this.second;
    }
    get Length() {
        return distPP(this.first, this.second);
    }
    CompareTo(other) {
        const cr = comparePointsXFirst(this.first, other.first);
        if (cr != 0) {
            return cr;
        }
        return comparePointsXFirst(this.second, other.second);
    }
    static equal(pair0, pair1) {
        return pair0.first.equal(pair1.first) && pair0.second.equal(pair1.second);
    }
    toString() {
        return this.first + (' ' + this.second);
    }
}
//# sourceMappingURL=pointPair.js.map