import type { Location } from "@deadhead/content"; import type { GameTime } from "./clock"; import { locationPosition } from "./positions"; /** Straight-line distance between two locations at a game time, in million km. */ export function routeDistance(from: Location, to: Location, gameTime: GameTime): number { const a = locationPosition(from, gameTime); const b = locationPosition(to, gameTime); return Math.hypot(b.x - a.x, b.y - a.y); }