ts-scikit
Version:
A scientific toolkit written in Typescript
43 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tuple3 = void 0;
/**
* A tuple with 3 components: x, y, and z.
*/
class Tuple3 {
/**
* Constructs a new tuple with three specified components.
* @param x the x-component.
* @param y the y-component.
* @param z the z-component.
*/
constructor(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
/**
* 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 Tuple3(this.x, this.y, this.z);
}
/**
* 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 && this.z === o.z);
}
}
exports.Tuple3 = Tuple3;
//# sourceMappingURL=tuple3.js.map