import type { Area, Shape } from "../fields.types.ts"; import type { Parts } from "./oval.ts"; import type { AthleticsFieldEvent } from "./types.ts"; /** A point in the plan. */ type Pt = readonly [number, number]; /** What a facility is, as data: where it stands, which way it throws or jumps, and the figures that say how big it is. */ export interface Facility { id: string; event: AthleticsFieldEvent; /** The throw's circle centre, the javelin arc's centre point, the high jump's bar centre, the pole vault's box, the jump's take-off board. */ x: number; y: number; /** The direction of the throw or the jump, in radians clockwise from the right as the eye sees it. */ heading: number; /** A box round all of it, for the ranges. */ box: { x0: number; y0: number; x1: number; y1: number; }; /** The length of the sector, or the runway, or the run-up. */ reach?: number; } /** The angle of a throw's sector: 34.92 degrees (Rule 32, landing sector; Manual 2.4.1.4). Its lines are 12 m apart (the chord) 20 m from the circle's centre, 0.60 m more for each metre further: 2 asin(0.3). */ export declare const SECTOR_ANGLE: number; /** The javelin sector's half angle: the arc's radius is 8 m and the runway 4 m wide, so the lines through the arc's ends make 28.96 degrees (Rule 32, landing sector; Figure 2.4.3.2). */ export declare const JAVELIN_HALF: number; /** A rectangle in the plan, `w` along `heading` and `h` across it, centred at `c`, as an area. */ export declare function rectArea(id: string, cls: Area["cls"], feature: string, c: Pt, heading: number, w: number, h: number): Area; /** The outline of the same rectangle as a line. */ export declare function rectLine(id: string, feature: string, c: Pt, heading: number, w: number, h: number, wLine: number): Shape; /** The sector of a throw: its two lines from the circle's rim to the arc, and the arc, 50 mm wide, the inner edges through the circle's centre (Rule 32, landing sector). */ export declare function sectorShapes(id: string, feature: string, c: Pt, heading: number, rim: number, reach: number, half?: number): Shape[]; /** A throwing circle (Rule 32, throwing circle, and 32.8; Manual 2.4.1.2): the concrete inside the rim, the rim, the 0.75 m lines at right angles to the sector's axis, the centre. `d` is the inside diameter. */ export declare function circleParts(id: string, event: AthleticsFieldEvent, c: Pt, heading: number, d: number, rim?: number): Parts; /** The shot put's stop board (Rule 33.2; Manual 2.4.4.3): an arc on the circle's inside edge, 1.21 m long (the chord), 0.112 m wide, centred on the sector's axis. */ export declare function stopBoard(id: string, c: Pt, heading: number, d: number): Area; /** * A discus or hammer cage in plan (Rules 35 and 37; Manual 2.4.1.3, Figure 2.4.1.2): U-shaped, its mouth 6 m wide and 7 m in front of the circle's centre, the netting no nearer than 3 m behind it. The * mouth and the line the sides take to it are the rules'; the rear is drawn as an arc about the centre, which is ours. */ export declare function cageShapes(id: string, c: Pt, heading: number): Shape[]; /** The javelin's runway and arc (Rule 32, javelin throw runway; Manual 2.4.3.2 and 2.4.3.3), about the centre point of the arc and the throwing direction `heading` (0 throws right). */ export declare function javelinParts(id: string, c: Pt, heading: number, runway?: number): { parts: Parts; facility: Facility; }; /** The box round some points. */ export declare function bounds(points: readonly Pt[]): { x0: number; y0: number; x1: number; y1: number; }; /** * A high jump facility (Rule 27; Manual 2.3.3): the uprights 4.02 m apart (Rule 27.6: 4.00 to 4.04 m), the crossbar, the landing mat of 6 m by 4 m at the least (Rule 27, landing area; Manual 2.3.3.4) with the bar's * plane 0.5 m inside its front edge, the 50 mm line 3 m outside each upright (Rule 27.2, note) and the run-up: a 16 m wide area, 15 m long (Rule 27.3: 25 m for the major competitions), drawn * as a dashed outline cut by the arc of the 15 m radius. `heading` is the way the athlete jumps; the facility is about the bar's middle. */ export declare function highJumpParts(id: string, c: Pt, heading: number, runup?: number): { parts: Parts; facility: Facility; }; /** * A pole vault's box and 0-line at the end of a runway (Rule 28; Manual 2.3.4.2): the box 1.00 m long, 0.60 m wide at the front and 0.15 m at the stop board, set so that the top inside * edge of the stop board is on the 0-line, which is 10 mm wide and runs on past the uprights (5.20 m apart at the least). `c` is the middle of the stop board and `heading` the way the athlete * runs; the landing mat of 6.00 m by 6.00 m at the least with front pieces 2 m long (Rule 28; Manual 2.3.4.4) lies beyond, its front 0.10 to 0.15 m from the box. */ export declare function poleVaultEnd(id: string, c: Pt, heading: number): { parts: Parts; facility: Facility; }; /** The runway of a jump: two lines 1.22 m apart (Rule 29; Manual 2.3.1.2) from `from` to `to` along `heading`, as lines. */ export declare function runwayLines(id: string, event: AthleticsFieldEvent, from: Pt, to: Pt, width?: number): Shape[]; /** A landing pit (Rule 30; Manual 2.3.1.4): the sand with its white border, `length` long along the jump and `width` across it, centred at `c`. */ export declare function pitParts(id: string, event: AthleticsFieldEvent, c: Pt, heading: number, length: number, width: number): Parts; /** A take-off board (Rule 29, take-off board; Manual 2.3.1.3): 1.22 m by 0.20 m, white, whose edge nearer the pit is the take-off line, `d` metres from the pit's near end. `pitEdge` is that end's middle. */ export declare function takeOffBoard(id: string, event: AthleticsFieldEvent, pitEdge: Pt, heading: number, d: number): Area; export {};