ts-scikit
Version:
A scientific toolkit written in Typescript
41 lines • 981 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tuple2 = void 0;
/**
* A tuple with 2 components: x and y.
*/
class Tuple2 {
/**
* Constructs a new tuple with two specified components.
* @param x the x-component.
* @param y the y-component.
*/
constructor(x, y) {
this.x = x;
this.y = y;
}
/**
* Creates a new tuple from an existing one.
* @param t the tuple.
*/
static FromExisting(t) {
return t.clone();
}
/**
* Copies this tuple.
* @returns a copy of this tuple.
*/
clone() {
return new Tuple2(this.x, this.y);
}
/**
* Determines if the components of this tuple equal those of another tuple.
* @param o the tuple.
* @returns true, if equals; false, otherwise.
*/
equals(o) {
return (this.x === o.x && this.y === o.y);
}
}
exports.Tuple2 = Tuple2;
//# sourceMappingURL=tuple2.js.map