import { type LongTrackFigures } from "../leagues/skating.ts"; /** The lane of a skater on the finishing straight: the inner or the outer (the one on the left, nearer the infield). */ export type Lane = 0 | 1; /** The shape of a long track, from the radius of the inner edge, the width of the outer lane and the lap. */ export interface LongOval { /** The radius of the inner edge of the inner lane (a in the table). */ a: number; /** The widths of the inner lane and of the outer lane. */ w1: number; w2: number; /** The radii of the lines each lane is measured on (d and e in the table): 0.5 m outside the inner edge of the lane. */ d: number; e: number; /** The length of each straight, from the end of one curve to the beginning of the next (f in the table). */ straight: number; /** The crossing: from the inner lane's line at one end of the straight to the outer lane's at the other. */ crossing: number; lap: number; } /** * The track for an inner radius `a` and an outer lane `w2` wide: the straight is the one that makes a lap 400 m, f + sqrt(f^2 + w1^2) + pi (d + e) = lap, where f is the straight skated twice a lap (once * on the finishing straight and once crossing). For a = 25 m, 25.5 m and 26 m with lanes of 4 m this is the table's 113.57 m, 112.00 m and 110.43 m. * @throws RangeError for a radius or a lane outside what Rule 203 allows. */ export declare function longOval(a?: number, w2?: number, fig?: LongTrackFigures): LongOval; /** The radius of the line a lane is measured on: 0 inner, 1 outer. */ export declare const laneRadius: (o: LongOval, lane: Lane) => number; /** The radius of the edges of the lanes, from the inner edge of the warm-up lane out to the outer edge of the outer lane: the warm-up lane's inner edge, the inner edge, the line between the lanes, the outer edge. */ export declare const laneEdges: (o: LongOval, warmUp: number) => { warmUp: number; inner: number; between: number; outer: number; }; /** The radius of the outer edge of the outer lane. */ export declare const outerEdge: (o: LongOval) => number; /** Where a skater is: a point of the track, the heading (0 is to the right, growing clockwise as the eye sees it), the part of the lap and how far across the lanes (0 on the inner line, 1 on the outer). */ export interface Pose { x: number; y: number; heading: number; part: "finishing-straight" | "first-curve" | "crossing" | "second-curve"; /** The lap's number, from the lap the coordinate zero begins. */ lap: number; /** 0 on the inner lane's line, 1 on the outer's, between on the crossing. */ across: number; } /** * The pose `v` metres along the skater's own way, `v` measured from the beginning of the finishing straight (its left end, x = -f/2) of the lap the skater starts in, the lap 0. `lane` is the skater's * lane there; it alternates every lap (Rule 254.5a). In a lap the skater skates the finishing straight and the first curve in the lap's lane, the crossing from it to the other lane, and the second * curve in the other. With `noChange` the crossing of the lap 0 keeps the lane, as the first straight of the 1000 m and the 1500 m does (Rule 254.5b): the lap 0 has one lane, and the laps alternate on. */ export declare function pose(o: LongOval, lane: Lane, v: number, noChange?: boolean): Pose; /** The coordinate of the finishing line on the lap 0's finishing straight, from the straight's beginning: the 400 m mark is 100 m on (Rule 227.2 and the layout plan: h = f - 100). */ export declare const finishAt: (o: LongOval, line: "400m" | "1000m") => number; /** The x of a coordinate on a straight of the lap 0 (the finishing straight), or `undefined` where it is not on it. */ export declare const xOfFinishing: (o: LongOval, u: number) => number; /** * Where a skater in lane `lane` starts a race of `distance` metres that finishes at `finish` metres along the finishing straight (`finishAt`): back from the finishing line along the skater's own way. * `noChange` says the race's first straight keeps its lane (the 1000 m and the 1500 m, Rule 254.5b). Returns the skater's coordinate `v0` at the start, inside the lap it starts in, and the pose there; a * skater who has skated `s` metres is at `pose(o, lane, v0 + s, noChange)`. */ export declare function startOf(o: LongOval, lane: Lane, distance: number, finish: number, noChange?: boolean): { v0: number; pose: Pose; };