import { type Scaled, type Unit } from "./units.ts"; import { SOCCER } from "./surfaces/soccer-spec.ts"; import { AFL_GROUND } from "./leagues/aussie.ts"; import { ICC_MEN_GROUND } from "./leagues/cricket.ts"; import { FIH_PITCH } from "./leagues/fieldhockey.ts"; import { GAA_FOOTBALL_FIELD } from "./leagues/gaelic.ts"; import { IHF_COURT } from "./leagues/handball.ts"; import { ARTISTIC, DIVING, SWIMMING, WATER_POLO } from "./pool.figures.ts"; import { WORLD_MEN_FIELD } from "./leagues/lacrosse.ts"; import { WORLD_RUGBY_FIELD } from "./leagues/rugby.ts"; import type { Sport } from "./types.ts"; export declare const FEET_PER_YARD = 3; export declare const FEET_PER_METRE = 3.280839895; /** Inches as feet. */ export declare const inch: (n: number) => number; /** A football field. Lengths are along the field from end line to end line, widths across it. */ export interface FootballSpec { id: "nfl" | "cfl" | "ifaf"; /** The name written in the title. */ name: string; /** Goal line to goal line. */ length: number; /** The depth of each end zone. */ endZone: number; /** Sideline to sideline. */ width: number; /** Distance of the hash-mark lines from each sideline. */ hash: number; /** The width of the band of the boundary lines, outside the field of play. */ boundary: number; /** The band across the field, measured from a sideline, in which the numbers stand: nearest edge, farthest edge. */ numbers: [number, number]; /** Where the goal posts stand: on the end line, or on the goal line. */ posts: "end-line" | "goal-line"; /** The text on the centre line when it is not a number. */ centre: string; /** Yard lines are drawn every this many feet. */ yardLine: number; /** The space between the two uprights, inside to inside, when not the usual `GOALPOST_WIDTH`. */ postWidth?: number; /** True for a field whose rules give no yard numbers: none are drawn. */ noNumbers?: boolean; /** False for a field with walls and no pylons (an indoor field). Pylons are drawn by default. */ pylons?: boolean; } /** The space between the two uprights, inside to inside. */ export declare const GOALPOST_WIDTH = 18.5; /** Hash marks and sideline ticks are this long (across the field). */ export declare const HASH_LENGTH = 2; /** NFL: Rule 1 of the NFL rulebook. CFL: the CFL rulebook, "The Field". IFAF: Appendix D of the IFAF 2021 rules, "Field Diagrams". */ export declare const FOOTBALL: Record; /** The length of a football field with its end zones. */ export declare const footballLength: (spec: FootballSpec) => number; /** The NHL rink as it is today, from Rule 1 of the NHL rulebook. `rulesFor("nhl", year)` (eras.ts) has it as it was in a season. */ export declare const NHL: { readonly length: 200; readonly width: 85; readonly cornerRadius: 28; readonly goalLine: 11; readonly blueLine: 75; /** The goal line is 2 inches wide, the blue and red lines 12. */ readonly goalLineWidth: number; readonly lineWidth: 1; readonly circleRadius: 15; /** The end-zone spots are 20 feet from the goal line and 22 feet either side of the long axis. */ readonly endSpotFromGoalLine: 20; readonly spotOffset: 22; readonly spotRadius: 1; /** The neutral-zone spots are 5 feet from the blue line. */ readonly neutralSpotFromBlue: 5; readonly centreSpotRadius: 0.5; /** The hash marks beside an end-zone circle are 2 feet long and 2 inches wide, 5 feet 7 inches apart (Rule 1.9): the gap between the near ends of the two marks, along the line parallel to the goal line; their width lies across it. */ readonly hashLength: 2; readonly hashApart: number; readonly crease: { readonly radius: 6; readonly depth: 4.5; readonly halfWidth: 4; }; readonly net: { readonly width: 6; readonly depth: number; }; readonly trapezoid: { readonly atBoards: 28; readonly atGoalLine: 22; }; readonly refereeCrease: 10; }; /** The NBA court as it is today, from Rule 1 of the NBA rulebook and the court diagram. `rulesFor("nba", year)` has it as it was in a season. */ export declare const NBA: { readonly length: 94; readonly width: 50; readonly lane: 16; /** The free-throw line is 15 feet from the plane of the backboard, which is 4 feet from the baseline. */ readonly freeThrowLine: 19; readonly freeThrowRadius: 6; readonly centreRadius: 6; readonly centreInnerRadius: 2; readonly threePoint: { readonly radius: 23.75; readonly corner: 22; readonly sideInset: 3; }; /** The centre of the basket, from the baseline. */ readonly basket: 5.25; readonly backboard: { readonly width: 6; readonly fromBaseline: 4; }; readonly restricted: 4; readonly rim: 0.75; /** The lower defensive box's marks: 3 feet from the lane, 13 feet from the baseline, 6 inches long. */ readonly boxMark: { readonly fromLane: 3; readonly fromBaseline: 13; readonly length: 0.5; }; readonly sidelineMark: { readonly fromBaseline: 28; readonly length: 3; }; readonly substitution: 4; /** The marks that divide the free-throw lane, from the baseline. The first is the block. */ readonly laneMarks: readonly [7, 11, 14, 17]; }; /** Where the three-point arc meets the straight lines, measured from the baseline. */ export declare function threePointJoin(): number; /** * The curling sheet, from R1 of World Curling's Rules of Curling (1 September 2026) and Rule 3 of Curling Canada's Rules of Curling for General * Play (September 2022 to August 2026), in feet as the second prints them and the first prints beside its metres. The sheet is drawn at the * largest the rules allow: the length is 150 feet (R1(a) of World Curling: "minimum 150 feet"; Curling Canada allows 146 to 150), the width * 15 feet 7 inches (4.750 m, the greatest of both). Lengths run along the sheet from the backboard, widths across it. */ export declare const CURLING: { readonly length: 150; readonly width: number; /** The least length and width the rules allow: 146 feet in an existing facility; 14 ft 6 in (World Curling) and 14 ft 2 in (Curling Canada). */ readonly lengthMin: 146; readonly widthMin: { readonly wcf: 14.5; readonly curlingCanada: number; }; /** Each tee line's centre is 57 feet from the middle of the sheet: 114 feet from tee to tee, 18 feet from the backboard on a 150-foot sheet. */ readonly teeFromMiddle: 57; /** The back line's outside edge is 6 feet from the tee line's centre; the hog line's inside edge is 21 feet from it. */ readonly backLine: 6; readonly hogLine: 21; /** The centre line runs 12 feet beyond each tee; the hacks stand there. */ readonly centreBeyondTee: 12; /** The radii of the 12-, 8- and 4-foot circles and the button (at least 6 inches). */ readonly rings: { readonly twelve: 6; readonly eight: 4; readonly four: 2; readonly button: 0.5; }; /** The widths: tee, back and centre lines are at most half an inch; the hog line is 4 inches. */ readonly lineWidth: number; readonly hogLineWidth: number; /** A hack is at most 6 inches wide and 8 inches deep, its inside edge 3 inches from the centre line. */ readonly hack: { readonly insideFromCentre: 0.25; readonly width: 0.5; readonly depth: number; }; /** World Curling's hack line, 1 ft 6 in long, and its courtesy lines, 6 in long and 4 feet outside each hog line. */ readonly hackLine: 1.5; readonly courtesy: { readonly length: 0.5; readonly outsideHog: 4; }; /** A stone has a circumference of at most 36 inches. It is drawn at that, a little over 11 inches across. */ readonly stoneCircumference: 3; }; /** The diameter of a curling stone drawn at the greatest circumference the rules allow (36 inches), in feet. */ export declare const STONE_DIAMETER: number; /** * The net sports' courts, in feet, from the rulebooks' own figures (leagues/courts.ts, docs/sources.md): the ITF's tennis court (Rule 1), the FIVB's indoor and beach * volleyball courts (Rules 1 and 2), the BWF's badminton court (Law 1), USA Pickleball's court (Section 3) and the ITTF's table (Laws 2.1 and 2.2). The lengths run * along the court from the end line, the widths across it, each to the outside of the lines. */ export declare const TENNIS: import("./leagues.ts").TennisFigures; export declare const VOLLEYBALL: import("./leagues.ts").VolleyballFigures; export declare const BEACH_VOLLEYBALL: import("./leagues.ts").VolleyballFigures; export declare const BADMINTON: import("./leagues.ts").BadmintonFigures; export declare const PICKLEBALL: import("./leagues.ts").PickleballFigures; export declare const TABLE_TENNIS: import("./leagues.ts").TableTennisFigures; export declare const SITTING_VOLLEYBALL: import("./leagues.ts").VolleyballFigures; export declare const PADEL: import("./leagues.ts").PadelFigures; export declare const SQUASH: import("./leagues.ts").SquashFigures; export declare const RACQUETBALL: import("./leagues.ts").RacquetballFigures; export declare const SEPAK_TAKRAW: import("./leagues.ts").SepakTakrawFigures; export declare const TEQBALL: import("./leagues.ts").TeqballFigures; export declare const ROUNDNET: import("./leagues.ts").RoundnetFigures; export declare const NETBALL: import("./leagues.ts").NetballFigures; /** The baseball field, from rules 2.01 to 2.05 of the Official Baseball Rules. */ export declare const MLB: { readonly base: 90; /** The side of first, second and third base: 18 inches since 2023 (Rule 2.03), 15 before. `rulesFor("mlb", year)` (eras.ts) has the size of a season. */ readonly baseSize: number; /** The back point of home plate is the origin; the pitcher's plate is this far from it. */ readonly pitcher: 60.5; readonly moundRadius: 9; /** The infield's dirt is cut by an arc of this radius round the pitcher's plate. */ readonly skinRadius: 95; readonly homeCircleRadius: 13; readonly baseCircleRadius: 10; /** The warning track is not set by the rules; fifteen feet is usual. */ readonly warningTrack: 15; /** The least backstop distance. */ readonly backstop: 60; readonly runningLane: { readonly from: 45; readonly width: 3; }; readonly boxes: { readonly batterWidth: 4; readonly batterLength: 6; readonly gap: 0.5; }; readonly plate: { readonly width: number; readonly side: number; }; }; /** The distance along the diagonal from home plate to second base. */ export declare const secondBase: () => number; /** Where the infield arc meets a foul line, along the line, from the back of home plate. The baseball field's by default; a league's pitching distance and arc if given. */ export declare function skinJoin(pitcher?: number, skinRadius?: number): number; /** The default fence of a ballpark: the usual 330, 375, 400, 375 and 330 feet. */ export declare const DEFAULT_FENCE: { readonly left: 330; readonly leftCenter: 375; readonly center: 400; readonly rightCenter: 375; readonly right: 330; }; /** A fence point: the angle from dead centre field (negative to the left field line, positive to the right) and the distance in feet. */ export type FencePoint = readonly [angle: number, feet: number]; /** The angles the five usual fence distances are taken at. */ export declare const FENCE_ANGLES: readonly [-45, -22.5, 0, 22.5, 45]; /** A fence made of the five usual distances. */ export declare function fencePoints(fence: { left: number; leftCenter: number; center: number; rightCenter: number; right: number; }): FencePoint[]; /** * The distance to the fence at an angle: a monotone cubic through the points (Fritsch and Carlson), so that the wall is * smooth and never swings out past the figures it was made from. Outside the points' angles it holds the end distance. * @example * ```ts * import { fenceAt, fencePoints, DEFAULT_FENCE } from "@johnmorrisdotca/kyogijo-stadiums/geometry"; * const points = fencePoints(DEFAULT_FENCE); * console.log(fenceAt(points, 0), fenceAt(points, -45)); * // 400 330 * ``` */ export declare function fenceAt(points: readonly FencePoint[], angle: number): number; /** The sports whose surface has one size. A ballpark's size is its fence, which `fenceIn` gives. */ export type SizedSport = Exclude; /** * The length and the width of a surface, in a unit: the rulebook's own (`SURFACE_UNITS`) when none is given. A football * field is measured with its end zones, end line to end line. * @example * ```ts * import { surfaceSize } from "@johnmorrisdotca/kyogijo-stadiums/geometry"; * console.log(surfaceSize("nfl"), surfaceSize("nhl", "m").length.toFixed(2)); * // { length: 120, width: 53.333333333333336, unit: 'yd' } 60.96 * ``` */ export declare function surfaceSize(sport: SizedSport, unit?: Unit): { length: number; width: number; unit: Unit; }; /** * Every dimension of a sport's surface in a unit (the rulebook's own when none is given): the football spec, `NHL`, `NBA` or * `MLB` with each length converted and every name and flag kept. */ export declare function dimensionsOf(sport: "nhl", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "nba", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "mlb", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "nfl" | "cfl" | "ifaf", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "soccer", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "curling", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "tennis", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "volleyball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "badminton", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "pickleball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "tabletennis", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "padel", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "squash", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "racquetball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "sepaktakraw", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "teqball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "roundnet", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "netball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "lacrosse", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "rugby", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "afl", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "gaelic", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "cricket", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "fieldhockey", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "handball", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "swimming", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "waterpolo", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "diving", unit?: Unit): Scaled; export declare function dimensionsOf(sport: "artisticswimming", unit?: Unit): Scaled; export declare function dimensionsOf(sport: Sport, unit?: Unit): unknown; /** A fence's points with each distance in another unit; the angles stay as they are. Feet are the default for `from`. */ export declare function fenceIn(points: readonly FencePoint[], to: Unit, from?: Unit): FencePoint[];