feat: scaffold Svelte app with shared types and scale calculation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4284f2533b
commit
a39122c504
12 files changed
+1491
No files matched your search
@@ -0,0 +1,7 @@
|
||||
import type { Point } from './types';
|
||||
|
||||
export function scaleFromLine(a: Point, b: Point, lengthMm: number): number | null {
|
||||
const lengthPx = Math.hypot(b.x - a.x, b.y - a.y);
|
||||
if (!(lengthMm > 0) || lengthPx < 1) return null;
|
||||
return lengthPx / lengthMm;
|
||||
}
|
||||
Reference in new issue
Block a user