import { Bike, Cyclist } from '../types/models'; import { Path } from '../types/path'; /** * Course configuration for MaxSpeedComputer using actual class instances */ export interface MaxSpeedCourse { readonly path: Path; readonly cyclist: Cyclist; readonly bike: Bike; } /** * MaxSpeedComputer calculates maximum safe speeds for cycling based on: * 1. Cornering physics (lean angle limits) * 2. Braking constraints (deceleration limits) * * Uses a single backward pass algorithm that combines both constraints: * - For each point (working backwards): compute v_max = min(cornering_limit, braking_limit) * - Cornering limit: v = √(g × radius × tan(max_lean_angle)) * - Braking limit: max speed that can safely brake to next point's speed * * Based on bicycle dynamics and physics research. */ export declare class MaxSpeedComputer { private constructor(); /** * Compute maximum safe speeds for all points in the course. * * Single backward pass: Calculate maximum speeds based on both cornering physics * and braking constraints. Works backwards through the path, ensuring each point's * speed is limited by both local geometry (cornering) and ability to brake to * the next point's speed. * * At each point i: v_max[i] = min(cornering_limit[i], max_speed_can_brake_to_v[i+1]) * * @param course Course containing path, cyclist, and bike parameters */ static computeMaxSpeeds(course: MaxSpeedCourse): void; /** * Compute maximum cornering speed limit for a point based on turning radius * and lean angle physics. * * Uses bicycle dynamics: v_max = √(g × radius × tan(max_lean_angle)) * * @param course Course containing cyclist parameters * @param currentIndex Index of current point * @returns Maximum speed limited by cornering physics */ private static computeCorneringLimit; private static computeRadiusWindowed; private static normalizeAngleDiff; /** * Compute maximum speed at a point that allows safe braking to the next point. * Uses kinematic equation to determine the maximum initial velocity that can * decelerate to the target velocity within the available distance. * * Formula: v₀ = √(vf² + 2 × a × distance) * where a is the braking deceleration (positive value) * * @param course Course containing cyclist braking parameters * @param currentIndex Index of current point (where we're computing max speed) * @param nextIndex Index of next point (target speed to brake to) * @returns Maximum speed that can safely brake to next point's speed */ private static computeBrakingLimit; } //# sourceMappingURL=MaxSpeedComputer.d.ts.map