diff --git a/src/point.js b/src/point.js index f5f4557f..c71e17c2 100644 --- a/src/point.js +++ b/src/point.js @@ -208,10 +208,17 @@ export class Point extends APoint { return this[AXES][Y]; } + /** + * @param {() => number} alg + * @returns {Point & number} + */ calc(alg) { return operatorCalc(alg, this); } + /** + * @returns {Point & number} + */ clone() { return new Point(this.x, this.y); } diff --git a/src/vector.js b/src/vector.js index 9f337134..17a7b988 100644 --- a/src/vector.js +++ b/src/vector.js @@ -306,6 +306,9 @@ export class Vector extends AVector { return operatorCalc(alg, this); } + /** + * @returns {Vector & number} + */ clone() { return new Vector(this.x, this.y, this.z); } @@ -319,11 +322,18 @@ export class Victor extends AVector { return new Vector(this.x, this.y, this.z); } + /** + * @returns {Vector & number} + */ clone() { return this; } } +/** + * @param {() => number} alg + * @returns {Vector & number} + */ export function calc(alg) { return operatorCalc(alg); }