import type { Pt } from "./crowd.ts"; import type { CircuitPlan } from "./circuits.ts"; /** The figures of the model, in metres and seconds. */ export declare const RACE_PACE: Readonly<{ /** The fastest the car goes on a straight: 94 m/s, about 338 km/h. */ top: 94; /** Grip across the car: `grip + downforce × v²` metres a second squared at a speed `v`, about 2.4 g in a hairpin and 5 g in a fast bend. */ grip: 22; downforce: 0.0036; /** How hard it brakes, and how hard it pulls away at rest; the pull falls to nothing at `top`. */ brake: 34; launch: 17; /** The line is read every `step` metres, and a bend is measured over `reach` either side: a racing car does not follow the middle of the road, so a short kink of it is not a bend. */ step: 5; reach: 32; /** The speed limit of the pit lane: 80 km/h. */ pitLimit: number; }>; /** A lap's speeds: one each `step` metres round the line from its first point, the time at each, and the lap's time and length. */ export interface PaceProfile { /** Metres between two samples. */ step: number; /** The length of the line, in metres. */ length: number; /** The speed at each sample, metres a second, and the seconds from the line's first point to each (one more than the speeds: the last is the lap's time). */ speed: Float64Array; time: Float64Array; /** The time of a flying lap, in seconds. */ lap: number; } /** The cumulative length of a ring at each of its points (the first 0, one more than the points: the last is the whole length). */ export declare function ringLengths(points: readonly Pt[]): Float64Array; /** The point of a ring `along` units round it from its first point (wrapped), from its lengths (`ringLengths`): found by halving, so a page can ask for twenty a frame. */ export declare function ringPoint(points: readonly Pt[], lengths: Float64Array, along: number): Pt; /** The same for an open line: held to its ends. */ export declare function linePoint(points: readonly Pt[], lengths: Float64Array, along: number): Pt; /** The fastest speed a bend of radius `r` metres allows: `v² = r × (grip + downforce × v²)`, and the top speed where the downforce holds it at any speed. */ export declare function cornerSpeed(r: number, pace?: Readonly<{ /** The fastest the car goes on a straight: 94 m/s, about 338 km/h. */ top: 94; /** Grip across the car: `grip + downforce × v²` metres a second squared at a speed `v`, about 2.4 g in a hairpin and 5 g in a fast bend. */ grip: 22; downforce: 0.0036; /** How hard it brakes, and how hard it pulls away at rest; the pull falls to nothing at `top`. */ brake: 34; launch: 17; /** The line is read every `step` metres, and a bend is measured over `reach` either side: a racing car does not follow the middle of the road, so a short kink of it is not a bend. */ step: 5; reach: 32; /** The speed limit of the pit lane: 80 km/h. */ pitLimit: number; }>): number; /** How hard the car can pull away at a speed: `launch` at rest, nothing at the top speed. */ export declare const pullAt: (v: number, pace?: Readonly<{ /** The fastest the car goes on a straight: 94 m/s, about 338 km/h. */ top: 94; /** Grip across the car: `grip + downforce × v²` metres a second squared at a speed `v`, about 2.4 g in a hairpin and 5 g in a fast bend. */ grip: 22; downforce: 0.0036; /** How hard it brakes, and how hard it pulls away at rest; the pull falls to nothing at `top`. */ brake: 34; launch: 17; /** The line is read every `step` metres, and a bend is measured over `reach` either side: a racing car does not follow the middle of the road, so a short kink of it is not a bend. */ step: 5; reach: 32; /** The speed limit of the pit lane: 80 km/h. */ pitLimit: number; }>) => number; /** * A plan's speeds round its lap (`circuitPlan`), from its line alone: the bends' radii give each sample's fastest speed, and two passes round (twice, so that the lap closes on itself) hold it to the engine and the * brakes. The same plan always gives the same profile. * @example * ```ts * import { circuitById, circuitPlan, paceProfile } from "@johnmorrisdotca/kyogijo-stadiums/circuits"; * const pace = paceProfile(circuitPlan(circuitById("las-vegas")!)); * console.log(pace.lap > 90 && pace.lap < 105, Math.max(...pace.speed) * 3.6 > 300); * // true true * ``` */ export declare function paceProfile(plan: CircuitPlan, pace?: Readonly<{ /** The fastest the car goes on a straight: 94 m/s, about 338 km/h. */ top: 94; /** Grip across the car: `grip + downforce × v²` metres a second squared at a speed `v`, about 2.4 g in a hairpin and 5 g in a fast bend. */ grip: 22; downforce: 0.0036; /** How hard it brakes, and how hard it pulls away at rest; the pull falls to nothing at `top`. */ brake: 34; launch: 17; /** The line is read every `step` metres, and a bend is measured over `reach` either side: a racing car does not follow the middle of the road, so a short kink of it is not a bend. */ step: 5; reach: 32; /** The speed limit of the pit lane: 80 km/h. */ pitLimit: number; }>): PaceProfile; /** The speed at `along` metres round the lap from the line's first point (wrapped), between the two samples either side. */ export declare function speedAt(profile: PaceProfile, along: number): number;