From ed566a3f657e8256df9aabd107c199e6971a8f96 Mon Sep 17 00:00:00 2001 From: Josh Kingsley Date: Sun, 26 Oct 2025 21:50:23 +0200 Subject: feat(web): subdivide cells --- web/src/math/Ratio.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'web/src/math/Ratio.ts') diff --git a/web/src/math/Ratio.ts b/web/src/math/Ratio.ts index d8e1149..0cca966 100644 --- a/web/src/math/Ratio.ts +++ b/web/src/math/Ratio.ts @@ -50,6 +50,13 @@ export default class Ratio { ); } + subtract(other: Ratio): Ratio { + return new Ratio( + this.numerator * other.denominator - other.numerator * this.denominator, + this.denominator * other.denominator, + ); + } + compare(other: Ratio): number { const left = this.numerator * other.denominator; const right = other.numerator * this.denominator; -- cgit v1.2.3