fifteen/apps/web/lib/isochrone.ts

9 lines
311 B
TypeScript

/** Compute up to 3 evenly-spaced contour values up to threshold (deduped, min 1). */
export function isochroneContours(threshold: number): number[] {
const raw = [
Math.max(1, Math.round(threshold / 3)),
Math.max(2, Math.round((threshold * 2) / 3)),
threshold,
];
return [...new Set(raw)];
}