@johnmorrisdotca/kyogijo-stadiums 0.0.0-stage → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +129 -0
- package/LICENSE +21 -0
- package/NOTICE.md +293 -0
- package/README.md +600 -2
- package/dist/annotate.d.ts +47 -0
- package/dist/annotate.js +349 -0
- package/dist/atlas-entry.d.ts +4 -0
- package/dist/atlas-entry.js +3 -0
- package/dist/atlas.d.ts +131 -0
- package/dist/atlas.js +149 -0
- package/dist/background.d.ts +56 -0
- package/dist/background.js +127 -0
- package/dist/ballpark.d.ts +48 -0
- package/dist/ballpark.js +129 -0
- package/dist/canvas-entry.d.ts +2 -0
- package/dist/canvas-entry.js +2 -0
- package/dist/canvas.d.ts +85 -0
- package/dist/canvas.js +279 -0
- package/dist/charts-entry.d.ts +10 -0
- package/dist/charts-entry.js +8 -0
- package/dist/charts.baseball.d.ts +30 -0
- package/dist/charts.baseball.js +152 -0
- package/dist/charts.curling.d.ts +52 -0
- package/dist/charts.curling.js +196 -0
- package/dist/charts.d.ts +172 -0
- package/dist/charts.js +508 -0
- package/dist/charts.network.d.ts +66 -0
- package/dist/charts.network.js +64 -0
- package/dist/charts.soccer.d.ts +43 -0
- package/dist/charts.soccer.js +191 -0
- package/dist/charts.types.d.ts +396 -0
- package/dist/charts.types.js +1 -0
- package/dist/colour.d.ts +29 -0
- package/dist/colour.js +97 -0
- package/dist/common.d.ts +14 -0
- package/dist/common.js +32 -0
- package/dist/court.d.ts +89 -0
- package/dist/court.js +248 -0
- package/dist/courts.style.d.ts +20 -0
- package/dist/courts.style.js +54 -0
- package/dist/cricket.board.d.ts +18 -0
- package/dist/cricket.board.js +67 -0
- package/dist/curling.board.d.ts +24 -0
- package/dist/curling.board.js +147 -0
- package/dist/d3-entry.d.ts +3 -0
- package/dist/d3-entry.js +2 -0
- package/dist/d3.d.ts +45 -0
- package/dist/d3.js +56 -0
- package/dist/draw.d.ts +52 -0
- package/dist/draw.js +705 -0
- package/dist/element-define.d.ts +2 -0
- package/dist/element-define.js +4 -0
- package/dist/element-entry.d.ts +1 -0
- package/dist/element-entry.js +2 -0
- package/dist/element.d.ts +39 -0
- package/dist/element.js +321 -0
- package/dist/eras-entry.d.ts +2 -0
- package/dist/eras-entry.js +2 -0
- package/dist/eras.d.ts +204 -0
- package/dist/eras.js +396 -0
- package/dist/events-entry.d.ts +3 -0
- package/dist/events-entry.js +3 -0
- package/dist/events.d.ts +54 -0
- package/dist/events.data.d.ts +59 -0
- package/dist/events.data.js +297 -0
- package/dist/events.js +127 -0
- package/dist/features.d.ts +31 -0
- package/dist/features.js +284 -0
- package/dist/field.score.d.ts +5 -0
- package/dist/field.score.js +33 -0
- package/dist/fields/afl.d.ts +11 -0
- package/dist/fields/afl.js +103 -0
- package/dist/fields/cricket.d.ts +9 -0
- package/dist/fields/cricket.js +81 -0
- package/dist/fields/fieldhockey.d.ts +6 -0
- package/dist/fields/fieldhockey.js +81 -0
- package/dist/fields/gaelic.d.ts +10 -0
- package/dist/fields/gaelic.js +86 -0
- package/dist/fields/handball.d.ts +6 -0
- package/dist/fields/handball.js +85 -0
- package/dist/fields/lacrosse.d.ts +17 -0
- package/dist/fields/lacrosse.js +169 -0
- package/dist/fields/rugby.d.ts +10 -0
- package/dist/fields/rugby.js +130 -0
- package/dist/fields.d.ts +12 -0
- package/dist/fields.js +44 -0
- package/dist/fields.kit.d.ts +63 -0
- package/dist/fields.kit.js +108 -0
- package/dist/fields.style.d.ts +4 -0
- package/dist/fields.style.js +19 -0
- package/dist/fields.types.d.ts +155 -0
- package/dist/fields.types.js +1 -0
- package/dist/format.d.ts +10 -0
- package/dist/format.js +28 -0
- package/dist/formations.d.ts +18 -0
- package/dist/formations.js +211 -0
- package/dist/frames-entry.d.ts +8 -0
- package/dist/frames-entry.js +7 -0
- package/dist/frames.d.ts +199 -0
- package/dist/frames.js +271 -0
- package/dist/frames.providers.d.ts +16 -0
- package/dist/frames.providers.js +302 -0
- package/dist/geojson-entry.d.ts +2 -0
- package/dist/geojson-entry.js +2 -0
- package/dist/geojson.d.ts +79 -0
- package/dist/geojson.js +147 -0
- package/dist/geometry-entry.d.ts +7 -0
- package/dist/geometry-entry.js +5 -0
- package/dist/geometry.d.ts +295 -0
- package/dist/geometry.js +361 -0
- package/dist/grounds-entry.d.ts +4 -0
- package/dist/grounds-entry.js +3 -0
- package/dist/grounds.d.ts +134 -0
- package/dist/grounds.data.d.ts +2 -0
- package/dist/grounds.data.js +1849 -0
- package/dist/grounds.js +74 -0
- package/dist/heat.colour.d.ts +37 -0
- package/dist/heat.colour.js +54 -0
- package/dist/heat.d.ts +43 -0
- package/dist/heat.js +614 -0
- package/dist/heat.stats.d.ts +123 -0
- package/dist/heat.stats.js +413 -0
- package/dist/heat.types.d.ts +145 -0
- package/dist/heat.types.js +1 -0
- package/dist/heat.zones.d.ts +54 -0
- package/dist/heat.zones.js +424 -0
- package/dist/homeside.d.ts +16 -0
- package/dist/homeside.js +43 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +29 -0
- package/dist/layers-entry.d.ts +19 -0
- package/dist/layers-entry.js +11 -0
- package/dist/layers.d.ts +41 -0
- package/dist/layers.env.d.ts +72 -0
- package/dist/layers.env.js +79 -0
- package/dist/layers.js +533 -0
- package/dist/layers.marks.d.ts +45 -0
- package/dist/layers.marks.js +168 -0
- package/dist/layers.types.d.ts +226 -0
- package/dist/layers.types.js +1 -0
- package/dist/layout.d.ts +97 -0
- package/dist/layout.js +381 -0
- package/dist/layout.style.d.ts +6 -0
- package/dist/layout.style.js +17 -0
- package/dist/layouts-entry.d.ts +5 -0
- package/dist/layouts-entry.js +4 -0
- package/dist/leagues/aussie.d.ts +57 -0
- package/dist/leagues/aussie.js +36 -0
- package/dist/leagues/baseball.d.ts +58 -0
- package/dist/leagues/baseball.js +171 -0
- package/dist/leagues/basketball.d.ts +67 -0
- package/dist/leagues/basketball.js +128 -0
- package/dist/leagues/courts.d.ts +212 -0
- package/dist/leagues/courts.js +114 -0
- package/dist/leagues/cricket.d.ts +45 -0
- package/dist/leagues/cricket.js +34 -0
- package/dist/leagues/curling.d.ts +64 -0
- package/dist/leagues/curling.js +53 -0
- package/dist/leagues/fieldhockey.d.ts +48 -0
- package/dist/leagues/fieldhockey.js +29 -0
- package/dist/leagues/fields.d.ts +10 -0
- package/dist/leagues/fields.js +6 -0
- package/dist/leagues/football.d.ts +8 -0
- package/dist/leagues/football.js +82 -0
- package/dist/leagues/gaelic.d.ts +50 -0
- package/dist/leagues/gaelic.js +29 -0
- package/dist/leagues/handball.d.ts +45 -0
- package/dist/leagues/handball.js +32 -0
- package/dist/leagues/hockey.d.ts +63 -0
- package/dist/leagues/hockey.js +166 -0
- package/dist/leagues/lacrosse.d.ts +103 -0
- package/dist/leagues/lacrosse.js +175 -0
- package/dist/leagues/rugby.d.ts +59 -0
- package/dist/leagues/rugby.js +72 -0
- package/dist/leagues/sources.d.ts +18 -0
- package/dist/leagues/sources.js +95 -0
- package/dist/leagues/types.d.ts +43 -0
- package/dist/leagues/types.js +5 -0
- package/dist/leagues-entry.d.ts +23 -0
- package/dist/leagues-entry.js +15 -0
- package/dist/leagues.d.ts +172 -0
- package/dist/leagues.js +462 -0
- package/dist/look.d.ts +50 -0
- package/dist/look.js +186 -0
- package/dist/mark.d.ts +35 -0
- package/dist/mark.js +59 -0
- package/dist/mount-entry.d.ts +2 -0
- package/dist/mount-entry.js +2 -0
- package/dist/mount.d.ts +63 -0
- package/dist/mount.js +167 -0
- package/dist/mow.d.ts +36 -0
- package/dist/mow.js +111 -0
- package/dist/names.d.ts +77 -0
- package/dist/names.js +97 -0
- package/dist/outline.d.ts +25 -0
- package/dist/outline.js +112 -0
- package/dist/parks-entry.d.ts +4 -0
- package/dist/parks-entry.js +3 -0
- package/dist/parks.d.ts +200 -0
- package/dist/parks.data.d.ts +2 -0
- package/dist/parks.data.js +4489 -0
- package/dist/parks.js +92 -0
- package/dist/plot-entry.d.ts +2 -0
- package/dist/plot-entry.js +2 -0
- package/dist/plot.d.ts +74 -0
- package/dist/plot.js +68 -0
- package/dist/png-entry.d.ts +2 -0
- package/dist/png-entry.js +2 -0
- package/dist/png.d.ts +26 -0
- package/dist/png.js +46 -0
- package/dist/ranges.d.ts +33 -0
- package/dist/ranges.js +178 -0
- package/dist/ranges.names.d.ts +31 -0
- package/dist/ranges.names.js +65 -0
- package/dist/react-entry.d.ts +2 -0
- package/dist/react-entry.js +2 -0
- package/dist/react.d.ts +53 -0
- package/dist/react.js +58 -0
- package/dist/replay-entry.d.ts +5 -0
- package/dist/replay-entry.js +4 -0
- package/dist/replay.control.d.ts +47 -0
- package/dist/replay.control.js +184 -0
- package/dist/replay.d.ts +170 -0
- package/dist/replay.dom.d.ts +21 -0
- package/dist/replay.dom.js +388 -0
- package/dist/replay.js +579 -0
- package/dist/replay.types.d.ts +152 -0
- package/dist/replay.types.js +1 -0
- package/dist/restyle.d.ts +21 -0
- package/dist/restyle.js +70 -0
- package/dist/road.d.ts +26 -0
- package/dist/road.draw.d.ts +6 -0
- package/dist/road.draw.js +269 -0
- package/dist/road.js +59 -0
- package/dist/road.model.d.ts +63 -0
- package/dist/road.model.js +215 -0
- package/dist/road.style.d.ts +7 -0
- package/dist/road.style.js +26 -0
- package/dist/road.types.d.ts +122 -0
- package/dist/road.types.js +1 -0
- package/dist/scene-entry.d.ts +7 -0
- package/dist/scene-entry.js +5 -0
- package/dist/scene.css.d.ts +44 -0
- package/dist/scene.css.js +296 -0
- package/dist/scene.d.ts +27 -0
- package/dist/scene.fit.d.ts +12 -0
- package/dist/scene.fit.js +18 -0
- package/dist/scene.flat.d.ts +38 -0
- package/dist/scene.flat.js +167 -0
- package/dist/scene.js +420 -0
- package/dist/scene.path.d.ts +40 -0
- package/dist/scene.path.js +357 -0
- package/dist/scene.types.d.ts +172 -0
- package/dist/scene.types.js +1 -0
- package/dist/scene.xml.d.ts +31 -0
- package/dist/scene.xml.js +81 -0
- package/dist/score.d.ts +70 -0
- package/dist/score.js +212 -0
- package/dist/sets.board.d.ts +22 -0
- package/dist/sets.board.js +89 -0
- package/dist/sheet.d.ts +18 -0
- package/dist/sheet.js +38 -0
- package/dist/special.d.ts +44 -0
- package/dist/special.js +204 -0
- package/dist/special.style.d.ts +8 -0
- package/dist/special.style.js +36 -0
- package/dist/strings.d.ts +581 -0
- package/dist/strings.js +411 -0
- package/dist/style.d.ts +35 -0
- package/dist/style.js +177 -0
- package/dist/surfaces/baseball.d.ts +33 -0
- package/dist/surfaces/baseball.js +208 -0
- package/dist/surfaces/baseball.walls.d.ts +16 -0
- package/dist/surfaces/baseball.walls.js +150 -0
- package/dist/surfaces/basketball.d.ts +8 -0
- package/dist/surfaces/basketball.js +199 -0
- package/dist/surfaces/curling.d.ts +23 -0
- package/dist/surfaces/curling.js +128 -0
- package/dist/surfaces/field.d.ts +12 -0
- package/dist/surfaces/field.js +163 -0
- package/dist/surfaces/football.d.ts +12 -0
- package/dist/surfaces/football.js +208 -0
- package/dist/surfaces/hockey.d.ts +10 -0
- package/dist/surfaces/hockey.js +166 -0
- package/dist/surfaces/net.d.ts +7 -0
- package/dist/surfaces/net.js +151 -0
- package/dist/surfaces/soccer-providers.d.ts +124 -0
- package/dist/surfaces/soccer-providers.js +334 -0
- package/dist/surfaces/soccer-spec.d.ts +138 -0
- package/dist/surfaces/soccer-spec.js +175 -0
- package/dist/surfaces/soccer.d.ts +25 -0
- package/dist/surfaces/soccer.js +270 -0
- package/dist/surfaces/surface.d.ts +180 -0
- package/dist/surfaces/surface.js +49 -0
- package/dist/team.common.d.ts +75 -0
- package/dist/team.common.js +97 -0
- package/dist/team.formation.d.ts +24 -0
- package/dist/team.formation.js +121 -0
- package/dist/team.geometry.d.ts +66 -0
- package/dist/team.geometry.js +304 -0
- package/dist/team.layers.d.ts +16 -0
- package/dist/team.layers.js +32 -0
- package/dist/team.motion.d.ts +9 -0
- package/dist/team.motion.js +325 -0
- package/dist/team.network.d.ts +43 -0
- package/dist/team.network.js +215 -0
- package/dist/team.shape.d.ts +12 -0
- package/dist/team.shape.js +217 -0
- package/dist/team.types.d.ts +189 -0
- package/dist/team.types.js +1 -0
- package/dist/text.d.ts +31 -0
- package/dist/text.js +88 -0
- package/dist/themes.d.ts +14 -0
- package/dist/themes.js +24 -0
- package/dist/types.d.ts +565 -0
- package/dist/types.js +1 -0
- package/dist/units.d.ts +45 -0
- package/dist/units.js +90 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +234 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { inFeet } from "./types.js";
|
|
2
|
+
/** A net sport's figures in feet, from the unit its rulebook gives them in. */
|
|
3
|
+
export const netInFeet = (figures, unit) => inFeet(figures, unit);
|
|
4
|
+
const inch = (n) => n / 12;
|
|
5
|
+
/**
|
|
6
|
+
* The ITF's court, from Rule 1 of the Rules of Tennis (2026) and its Appendix X, in feet as the ITF prints them: 78 feet long, 27 feet wide for singles and
|
|
7
|
+
* 36 feet for doubles; the net 3 feet 6 inches at the posts and 3 feet at the centre; the centres of the net posts 3 feet outside the doubles court and the
|
|
8
|
+
* centres of singles sticks 3 feet outside the singles court; the service lines 21 feet from the net; the centre mark 4 inches long and the centre service
|
|
9
|
+
* line 2 inches wide; the other lines 1 to 2 inches wide and the baselines up to 4 inches; posts at most 6 inches square, singles sticks 3. Appendix X
|
|
10
|
+
* recommends 21 feet behind the baselines and 12 feet beside the sidelines for international competitions, 18 and 10 for clubs.
|
|
11
|
+
*/
|
|
12
|
+
export const ITF_TENNIS = {
|
|
13
|
+
length: 78,
|
|
14
|
+
widthSingles: 27,
|
|
15
|
+
widthDoubles: 36,
|
|
16
|
+
serviceLine: 21,
|
|
17
|
+
lineWidth: inch(2),
|
|
18
|
+
baselineWidthMax: inch(4),
|
|
19
|
+
centreMark: { length: inch(4), width: inch(2) },
|
|
20
|
+
centreServiceWidth: inch(2),
|
|
21
|
+
net: { heightPosts: 3.5, heightCentre: 3, postsOutside: 3, sticksOutside: 3, postSize: inch(6), stickSize: inch(3) },
|
|
22
|
+
free: { official: { side: 12, end: 21 }, least: { side: 10, end: 18 } },
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The FIVB's indoor court, from Rules 1 and 2 of the Official Volleyball Rules 2025-2028, in metres as it prints them: 18 by 9 m inside a free zone of at least 3 m
|
|
26
|
+
* (5 m beside the side lines and 6.5 m behind the end lines in the FIVB's competitions); lines 5 cm wide inside the dimensions; the attack line's rear edge 3 m
|
|
27
|
+
* from the axis of the centre line and, in the FIVB's competitions, extended by five 15 cm lines 20 cm apart to 1.75 m; the service zone 9 m wide, limited by
|
|
28
|
+
* two 15 cm lines 20 cm behind the end line; the net 1 m wide and 9.50 to 10 m long, 2.43 m (men) or 2.24 m (women) high; each antenna 1.80 m long and 10 mm
|
|
29
|
+
* across, at the outer edge of a side band; the posts 0.50 to 1.00 m outside the side lines, 1 m in the FIVB's competitions.
|
|
30
|
+
*/
|
|
31
|
+
export const FIVB_INDOOR = {
|
|
32
|
+
length: 18,
|
|
33
|
+
width: 9,
|
|
34
|
+
lineWidth: 0.05,
|
|
35
|
+
attackLine: 3,
|
|
36
|
+
attackExtension: { length: 0.15, gap: 0.2, total: 1.75 },
|
|
37
|
+
serviceMarks: { length: 0.15, behind: 0.2 },
|
|
38
|
+
serviceZone: 9,
|
|
39
|
+
net: { length: 10, width: 1, heightMen: 2.43, heightWomen: 2.24, postsOutside: 1, postsOutsideLeast: 0.5, antenna: { length: 1.8, diameter: 0.01 } },
|
|
40
|
+
free: { official: { side: 5, end: 6.5 }, least: { side: 3, end: 3 } },
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The FIVB's beach court, from Rules 1 and 2 of the Official Beach Volleyball Rules 2025-2028, in metres: 16 by 8 m inside a free zone of at least 3 m (at least 5 m
|
|
44
|
+
* in the FIVB's competitions); lines 5 cm wide inside the dimensions and no centre line; the service zone 8 m wide; the net 8.5 m long and 1 m wide, at the same
|
|
45
|
+
* heights; the posts 0.70 to 1.00 m outside the side lines, 1 m in the FIVB's competitions.
|
|
46
|
+
*/
|
|
47
|
+
export const FIVB_BEACH = {
|
|
48
|
+
length: 16,
|
|
49
|
+
width: 8,
|
|
50
|
+
lineWidth: 0.05,
|
|
51
|
+
attackLine: null,
|
|
52
|
+
attackExtension: null,
|
|
53
|
+
serviceMarks: null,
|
|
54
|
+
serviceZone: 8,
|
|
55
|
+
net: { length: 8.5, width: 1, heightMen: 2.43, heightWomen: 2.24, postsOutside: 1, postsOutsideLeast: 0.7, antenna: { length: 1.8, diameter: 0.01 } },
|
|
56
|
+
free: { official: { side: 5, end: 5 }, least: { side: 3, end: 3 } },
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The BWF's court, from Law 1 of the Laws of Badminton (as amended 26 April 2025) and its Diagram A, in metres: 13.40 by 6.10 m, lines 40 mm wide; the singles
|
|
60
|
+
* side lines 460 mm inside the doubles side lines (so 5.18 m apart, outside to outside); the short service lines 1.98 m from the net; the doubles long service
|
|
61
|
+
* lines 760 mm inside the back boundary lines; the net 1.524 m high at the centre and 1.55 m over the doubles side lines, 760 mm deep and at least 6.1 m
|
|
62
|
+
* wide; the posts 1.55 m high, on the doubles side lines.
|
|
63
|
+
*/
|
|
64
|
+
export const BWF_BADMINTON = {
|
|
65
|
+
length: 13.4,
|
|
66
|
+
width: 6.1,
|
|
67
|
+
lineWidth: 0.04,
|
|
68
|
+
singlesInset: 0.46,
|
|
69
|
+
doublesLongServiceInset: 0.76,
|
|
70
|
+
shortServiceLine: 1.98,
|
|
71
|
+
net: { postHeight: 1.55, heightCentre: 1.524, heightSides: 1.55, depth: 0.76, widthMin: 6.1 },
|
|
72
|
+
free: { official: null, least: null },
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* USA Pickleball's court, from Section 3 of the 2026 rulebook, in feet as it prints them: 20 by 44 feet to the outside edge of the lines (3.A.1, 3.A.2); the
|
|
76
|
+
* non-volley zone 7 feet from the net (3.A.4.c); all lines 2 inches wide (3.A.4.e); the posts 22 feet apart, inside to inside, and at most 3 inches across
|
|
77
|
+
* (3.B.2); the net at least 21 feet 9 inches long (3.B.3), 36 inches high at the sidelines (3.B.6) and 34 inches at the centre (3.B.7); a playing surface of at least
|
|
78
|
+
* 30 by 60 feet, 34 by 64 feet recommended for tournaments (3.A.3).
|
|
79
|
+
*/
|
|
80
|
+
export const USAP_PICKLEBALL = {
|
|
81
|
+
length: 44,
|
|
82
|
+
width: 20,
|
|
83
|
+
nonVolley: 7,
|
|
84
|
+
lineWidth: inch(2),
|
|
85
|
+
net: { heightSides: 3, heightCentre: 34 / 12, postsInside: 22, postDiameter: inch(3), lengthMin: 21 + 9 / 12 },
|
|
86
|
+
free: { official: { side: 7, end: 10 }, least: { side: 5, end: 8 } },
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The ITTF's table, from Laws 2.1 and 2.2 of the Laws of Table Tennis (the 2026 statutes), in metres: 2.74 by 1.525 m and 76 cm above the floor; a white side line
|
|
90
|
+
* and end line 2 cm wide, a white centre line 3 mm wide; the net 15.25 cm above the playing surface, hung from posts 15.25 cm high whose outside limits are 15.25 cm
|
|
91
|
+
* outside the side lines.
|
|
92
|
+
*/
|
|
93
|
+
export const ITTF_TABLE = {
|
|
94
|
+
length: 2.74,
|
|
95
|
+
width: 1.525,
|
|
96
|
+
height: 0.76,
|
|
97
|
+
edgeLine: 0.02,
|
|
98
|
+
centreLine: 0.003,
|
|
99
|
+
net: { height: 0.1525, postHeight: 0.1525, postOutside: 0.1525 },
|
|
100
|
+
free: { official: null, least: null },
|
|
101
|
+
};
|
|
102
|
+
/** The tennis leagues: the ITF's. The ATP and the WTA play by the ITF's rules. */
|
|
103
|
+
export const TENNIS_LEAGUES = [{ id: "itf", family: "tennis", name: { en: "ITF tennis court", ja: "ITFのテニスコート" }, unit: "ft", dimensions: ITF_TENNIS, sources: ["itf-rules"], builtIn: true }];
|
|
104
|
+
/** The volleyball leagues: the FIVB's indoor court, and its beach court. */
|
|
105
|
+
export const VOLLEYBALL_LEAGUES = [
|
|
106
|
+
{ id: "fivb", family: "volleyball", name: { en: "FIVB volleyball court", ja: "FIVBのバレーボールコート" }, unit: "m", dimensions: FIVB_INDOOR, sources: ["fivb-volleyball"], builtIn: true },
|
|
107
|
+
{ id: "fivb-beach", family: "volleyball", name: { en: "FIVB beach volleyball court", ja: "FIVBのビーチバレーボールコート" }, unit: "m", dimensions: FIVB_BEACH, sources: ["fivb-beach"] },
|
|
108
|
+
];
|
|
109
|
+
/** The badminton leagues: the BWF's. */
|
|
110
|
+
export const BADMINTON_LEAGUES = [{ id: "bwf", family: "badminton", name: { en: "BWF badminton court", ja: "BWFのバドミントンコート" }, unit: "m", dimensions: BWF_BADMINTON, sources: ["bwf-laws"], builtIn: true }];
|
|
111
|
+
/** The pickleball leagues: USA Pickleball's. */
|
|
112
|
+
export const PICKLEBALL_LEAGUES = [{ id: "usap", family: "pickleball", name: { en: "USA Pickleball court", ja: "USA Pickleballのコート" }, unit: "ft", dimensions: USAP_PICKLEBALL, sources: ["usap-rulebook"], builtIn: true }];
|
|
113
|
+
/** The table tennis leagues: the ITTF's. */
|
|
114
|
+
export const TABLE_TENNIS_LEAGUES = [{ id: "ittf", family: "tabletennis", name: { en: "ITTF table", ja: "ITTFの卓球台" }, unit: "m", dimensions: ITTF_TABLE, sources: ["ittf-laws"], builtIn: true }];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Unit } from "../units.ts";
|
|
2
|
+
import { type Span } from "./fields.ts";
|
|
3
|
+
import { type LeagueBase } from "./types.ts";
|
|
4
|
+
/** The figures of the ground, in the unit of the table they are in (yards). */
|
|
5
|
+
export interface CricketFigures {
|
|
6
|
+
/** The pitch: its length (the distance between the bowling creases, which are its ends) and its width (5 feet either side of the line of the middle stumps). */
|
|
7
|
+
pitchLength: number;
|
|
8
|
+
pitchWidth: number;
|
|
9
|
+
/** The bowling crease's length; the popping crease's distance in front of it; how far the popping crease is marked either side of the line of the middle stumps (the creases are unlimited in length). */
|
|
10
|
+
bowlingCrease: number;
|
|
11
|
+
poppingCrease: number;
|
|
12
|
+
poppingEach: number;
|
|
13
|
+
/** The return creases: their inside edges' distance either side of that line, and how far they are marked behind the popping crease. */
|
|
14
|
+
returnOutside: number;
|
|
15
|
+
returnBehind: number;
|
|
16
|
+
/** A set of wickets' width. */
|
|
17
|
+
wicket: number;
|
|
18
|
+
/** The boundary, as its distance from the centre of the pitch: the range the rules allow and the one drawn. */
|
|
19
|
+
boundary: Span;
|
|
20
|
+
/** The radius of the semicircles of the fielding restriction (the 30-yard circle) about each middle stump, or none. */
|
|
21
|
+
circle: number | null;
|
|
22
|
+
/** The width of the lines: the Laws print none. */
|
|
23
|
+
lineWidth: number;
|
|
24
|
+
}
|
|
25
|
+
/** The ground as the drawing wants it: the figures with every length in feet. */
|
|
26
|
+
export type CricketSpec = CricketFigures;
|
|
27
|
+
/** The ground's figures in feet, from the unit the Laws give them in. */
|
|
28
|
+
export declare const cricketInFeet: (figures: CricketFigures, unit: Unit) => CricketSpec;
|
|
29
|
+
/** A league with a cricket ground of its own. */
|
|
30
|
+
export type CricketLeague = LeagueBase<"cricket", CricketFigures>;
|
|
31
|
+
/**
|
|
32
|
+
* The Laws of Cricket (MCC, 2017 Code, 4th Edition 2026): the pitch 22 yards by 10 feet (6.1); the bowling crease 8 ft 8 in (7.2); the popping crease 4 ft in front of it and marked at least 6 ft either side of
|
|
33
|
+
* the line of the middle stumps (7.3); the return creases 4 ft 4 in either side of that line (inside edges), marked 8 ft behind the popping crease (7.4); a set of wickets 9 in wide (8.1). No boundary size
|
|
34
|
+
* and no circle: the Laws have none (19), so the boundary is any size, 75 yards by default. The Laws print no width for the creases: 2 inches is drawn.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MCC_GROUND: CricketFigures;
|
|
37
|
+
/**
|
|
38
|
+
* The ICC men's playing conditions (effective from October 2026): the Laws' pitch and creases (6.1, 7.2 to 7.4, 8.1), the popping crease marked at least 25 ft either side (7.3), a boundary no longer than 90 yards
|
|
39
|
+
* and not shorter than 65 yards from the centre of the pitch (19.1.3), and the two semicircles of 30 yards about the middle stumps, linked by two parallel lines (28.7.2.1). 75 yards is drawn.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ICC_MEN_GROUND: CricketFigures;
|
|
42
|
+
/** The ICC women's playing conditions (ODI, effective from October 2026): a boundary of 60 to 70 yards (19.1.3) and semicircles of 25.15 yards (23 m, 28.7.2.1). 65 yards is drawn. */
|
|
43
|
+
export declare const ICC_WOMEN_GROUND: CricketFigures;
|
|
44
|
+
/** The cricket leagues: the ICC men's conditions first (the ground with the 30-yard circle), then the women's and the Laws. */
|
|
45
|
+
export declare const CRICKET_LEAGUES: readonly CricketLeague[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { span } from "./fields.js";
|
|
2
|
+
import { inFeet } from "./types.js";
|
|
3
|
+
const yds = (ft, inches = 0) => (ft * 12 + inches) / 36;
|
|
4
|
+
/** The ground's figures in feet, from the unit the Laws give them in. */
|
|
5
|
+
export const cricketInFeet = (figures, unit) => inFeet(figures, unit);
|
|
6
|
+
const pitch = {
|
|
7
|
+
pitchLength: 22,
|
|
8
|
+
pitchWidth: yds(10),
|
|
9
|
+
bowlingCrease: yds(8, 8),
|
|
10
|
+
poppingCrease: yds(4),
|
|
11
|
+
returnOutside: yds(4, 4),
|
|
12
|
+
returnBehind: yds(8),
|
|
13
|
+
wicket: yds(0, 9),
|
|
14
|
+
lineWidth: yds(0, 2),
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The Laws of Cricket (MCC, 2017 Code, 4th Edition 2026): the pitch 22 yards by 10 feet (6.1); the bowling crease 8 ft 8 in (7.2); the popping crease 4 ft in front of it and marked at least 6 ft either side of
|
|
18
|
+
* the line of the middle stumps (7.3); the return creases 4 ft 4 in either side of that line (inside edges), marked 8 ft behind the popping crease (7.4); a set of wickets 9 in wide (8.1). No boundary size
|
|
19
|
+
* and no circle: the Laws have none (19), so the boundary is any size, 75 yards by default. The Laws print no width for the creases: 2 inches is drawn.
|
|
20
|
+
*/
|
|
21
|
+
export const MCC_GROUND = { ...pitch, poppingEach: yds(6), boundary: span(0, Infinity, 75), circle: null };
|
|
22
|
+
/**
|
|
23
|
+
* The ICC men's playing conditions (effective from October 2026): the Laws' pitch and creases (6.1, 7.2 to 7.4, 8.1), the popping crease marked at least 25 ft either side (7.3), a boundary no longer than 90 yards
|
|
24
|
+
* and not shorter than 65 yards from the centre of the pitch (19.1.3), and the two semicircles of 30 yards about the middle stumps, linked by two parallel lines (28.7.2.1). 75 yards is drawn.
|
|
25
|
+
*/
|
|
26
|
+
export const ICC_MEN_GROUND = { ...pitch, poppingEach: yds(25), boundary: span(65, 90, 75), circle: 30 };
|
|
27
|
+
/** The ICC women's playing conditions (ODI, effective from October 2026): a boundary of 60 to 70 yards (19.1.3) and semicircles of 25.15 yards (23 m, 28.7.2.1). 65 yards is drawn. */
|
|
28
|
+
export const ICC_WOMEN_GROUND = { ...pitch, poppingEach: yds(25), boundary: span(60, 70, 65), circle: 25.15 };
|
|
29
|
+
/** The cricket leagues: the ICC men's conditions first (the ground with the 30-yard circle), then the women's and the Laws. */
|
|
30
|
+
export const CRICKET_LEAGUES = [
|
|
31
|
+
{ id: "icc-men", family: "cricket", name: { en: "ICC men's ground", ja: "ICC男子のグラウンド" }, unit: "yd", dimensions: ICC_MEN_GROUND, sources: ["mcc-laws", "icc-men-odi"], builtIn: true },
|
|
32
|
+
{ id: "icc-women", family: "cricket", name: { en: "ICC women's ground", ja: "ICC女子のグラウンド" }, unit: "yd", dimensions: ICC_WOMEN_GROUND, sources: ["mcc-laws", "icc-women-odi"] },
|
|
33
|
+
{ id: "mcc", family: "cricket", name: { en: "Laws of Cricket ground (MCC)", ja: "クリケット規則(MCC)のグラウンド" }, unit: "yd", dimensions: MCC_GROUND, sources: ["mcc-laws"] },
|
|
34
|
+
];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Unit } from "../units.ts";
|
|
2
|
+
import { type LeagueBase } from "./types.ts";
|
|
3
|
+
/** The figures of a curling sheet. Lengths, in the unit of the table they are in. */
|
|
4
|
+
export interface SheetFigures {
|
|
5
|
+
/** The sheet as drawn: backboard to backboard (inside edges), and sideline to sideline. The greatest the rules allow. */
|
|
6
|
+
length: number;
|
|
7
|
+
width: number;
|
|
8
|
+
/** The least length and the least width the rules allow. The greatest are `length` and `width`. */
|
|
9
|
+
lengthMin: number;
|
|
10
|
+
widthMin: number;
|
|
11
|
+
/** Each tee line's centre, from the middle of the sheet. */
|
|
12
|
+
teeFromMiddle: number;
|
|
13
|
+
/** The back line's outside edge, from the tee line's centre. */
|
|
14
|
+
backLine: number;
|
|
15
|
+
/** The hog line's inside edge (the circle side), from the tee line's centre. */
|
|
16
|
+
hogLine: number;
|
|
17
|
+
/** How far the centre line runs beyond each tee, which is where the hacks stand. */
|
|
18
|
+
centreBeyondTee: number;
|
|
19
|
+
/** The radii of the 12-, 8- and 4-foot circles and of the button. */
|
|
20
|
+
rings: [twelve: number, eight: number, four: number, button: number];
|
|
21
|
+
/** The widths of the tee, back and centre lines (at most), and of the hog line. */
|
|
22
|
+
lineWidths: {
|
|
23
|
+
line: number;
|
|
24
|
+
hog: number;
|
|
25
|
+
};
|
|
26
|
+
/** A hack: how far its inside edge is from the centre line, how wide it is, and how far it reaches in front of its line. */
|
|
27
|
+
hack: {
|
|
28
|
+
insideFromCentre: number;
|
|
29
|
+
width: number;
|
|
30
|
+
depth: number;
|
|
31
|
+
};
|
|
32
|
+
/** The hack line across the centre line, or none (Curling Canada's book has none). */
|
|
33
|
+
hackLine: number | null;
|
|
34
|
+
/** The courtesy lines at the sides, 6 inches long and 4 feet outside the hog lines, or none (Curling Canada's book has none). */
|
|
35
|
+
courtesy: {
|
|
36
|
+
length: number;
|
|
37
|
+
outsideHog: number;
|
|
38
|
+
} | null;
|
|
39
|
+
}
|
|
40
|
+
/** A sheet as the drawing wants it: the figures with every length in feet. */
|
|
41
|
+
export type SheetSpec = SheetFigures;
|
|
42
|
+
/** A sheet's figures in feet, from the unit its rulebook gives them in. */
|
|
43
|
+
export declare const sheetInFeet: (figures: SheetFigures, unit: Unit) => SheetSpec;
|
|
44
|
+
/** A league with a curling sheet of its own. */
|
|
45
|
+
export type CurlingLeague = LeagueBase<"curling", SheetFigures>;
|
|
46
|
+
/**
|
|
47
|
+
* World Curling's sheet, from R1 of The Rules of Curling and Rules of Competition (1 September 2026), in metres as it prints them: the sheet is
|
|
48
|
+
* at least 45.720 m long (146 ft, 44.501 m, in an existing facility) and at most 4.750 m wide (at least 4.420 m); each tee line is 17.375 m from
|
|
49
|
+
* the middle; the back line's outside edge is 1.829 m from the tee, the hog line's inside edge 6.401 m; the circles have radii of 1.829,
|
|
50
|
+
* 1.219 and 0.610 m and the button at least 0.152 m; the hog line is 102 mm wide, the others at most 13 mm; the centre line runs 3.658 m beyond
|
|
51
|
+
* each tee; the hack line is 457 mm long; the courtesy lines are 152 mm long and 1.219 m outside the hog lines; each hack's inside edge is 76
|
|
52
|
+
* mm from the middle of the centre line, at most 152 mm wide and 203 mm in front of its line.
|
|
53
|
+
*/
|
|
54
|
+
export declare const WCF_SHEET: SheetFigures;
|
|
55
|
+
/**
|
|
56
|
+
* Curling Canada's sheet, from Rule 3 of the Rules of Curling for General Play (September 2022 to August 2026), in feet as it prints them: 146 to
|
|
57
|
+
* 150 feet from backboard to backboard and 14 ft 2 in to 15 ft 7 in wide; 114 feet from tee to tee; the back line 6 feet from the tee; the hog
|
|
58
|
+
* line's inside edge 21 feet from it; the circles of 6, 4 and 2 feet and a button of at least 6 inches; the centre line 12 feet beyond each tee
|
|
59
|
+
* and the hacks' back edges there, each at most 8 inches long and its inside edge at most 3 inches from the centre line. The book prints no hack
|
|
60
|
+
* line and no courtesy line. Its hack width is not printed; World Curling's 6 inches is drawn.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CURLING_CANADA_SHEET: SheetFigures;
|
|
63
|
+
/** The curling leagues, World Curling's first. */
|
|
64
|
+
export declare const CURLING_LEAGUES: readonly CurlingLeague[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { inFeet } from "./types.js";
|
|
2
|
+
/** A sheet's figures in feet, from the unit its rulebook gives them in. */
|
|
3
|
+
export const sheetInFeet = (figures, unit) => inFeet(figures, unit);
|
|
4
|
+
/**
|
|
5
|
+
* World Curling's sheet, from R1 of The Rules of Curling and Rules of Competition (1 September 2026), in metres as it prints them: the sheet is
|
|
6
|
+
* at least 45.720 m long (146 ft, 44.501 m, in an existing facility) and at most 4.750 m wide (at least 4.420 m); each tee line is 17.375 m from
|
|
7
|
+
* the middle; the back line's outside edge is 1.829 m from the tee, the hog line's inside edge 6.401 m; the circles have radii of 1.829,
|
|
8
|
+
* 1.219 and 0.610 m and the button at least 0.152 m; the hog line is 102 mm wide, the others at most 13 mm; the centre line runs 3.658 m beyond
|
|
9
|
+
* each tee; the hack line is 457 mm long; the courtesy lines are 152 mm long and 1.219 m outside the hog lines; each hack's inside edge is 76
|
|
10
|
+
* mm from the middle of the centre line, at most 152 mm wide and 203 mm in front of its line.
|
|
11
|
+
*/
|
|
12
|
+
export const WCF_SHEET = {
|
|
13
|
+
length: 45.72,
|
|
14
|
+
width: 4.75,
|
|
15
|
+
lengthMin: 44.501,
|
|
16
|
+
widthMin: 4.42,
|
|
17
|
+
teeFromMiddle: 17.375,
|
|
18
|
+
backLine: 1.829,
|
|
19
|
+
hogLine: 6.401,
|
|
20
|
+
centreBeyondTee: 3.658,
|
|
21
|
+
rings: [1.829, 1.219, 0.61, 0.152],
|
|
22
|
+
lineWidths: { line: 0.013, hog: 0.102 },
|
|
23
|
+
hack: { insideFromCentre: 0.076, width: 0.152, depth: 0.203 },
|
|
24
|
+
hackLine: 0.457,
|
|
25
|
+
courtesy: { length: 0.152, outsideHog: 1.219 },
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Curling Canada's sheet, from Rule 3 of the Rules of Curling for General Play (September 2022 to August 2026), in feet as it prints them: 146 to
|
|
29
|
+
* 150 feet from backboard to backboard and 14 ft 2 in to 15 ft 7 in wide; 114 feet from tee to tee; the back line 6 feet from the tee; the hog
|
|
30
|
+
* line's inside edge 21 feet from it; the circles of 6, 4 and 2 feet and a button of at least 6 inches; the centre line 12 feet beyond each tee
|
|
31
|
+
* and the hacks' back edges there, each at most 8 inches long and its inside edge at most 3 inches from the centre line. The book prints no hack
|
|
32
|
+
* line and no courtesy line. Its hack width is not printed; World Curling's 6 inches is drawn.
|
|
33
|
+
*/
|
|
34
|
+
export const CURLING_CANADA_SHEET = {
|
|
35
|
+
length: 150,
|
|
36
|
+
width: 15 + 7 / 12,
|
|
37
|
+
lengthMin: 146,
|
|
38
|
+
widthMin: 14 + 2 / 12,
|
|
39
|
+
teeFromMiddle: 57,
|
|
40
|
+
backLine: 6,
|
|
41
|
+
hogLine: 21,
|
|
42
|
+
centreBeyondTee: 12,
|
|
43
|
+
rings: [6, 4, 2, 0.5],
|
|
44
|
+
lineWidths: { line: 0.5 / 12, hog: 4 / 12 },
|
|
45
|
+
hack: { insideFromCentre: 0.25, width: 0.5, depth: 8 / 12 },
|
|
46
|
+
hackLine: null,
|
|
47
|
+
courtesy: null,
|
|
48
|
+
};
|
|
49
|
+
/** The curling leagues, World Curling's first. */
|
|
50
|
+
export const CURLING_LEAGUES = [
|
|
51
|
+
{ id: "wcf", family: "curling", name: { en: "World Curling sheet", ja: "ワールドカーリングのシート" }, unit: "m", dimensions: WCF_SHEET, sources: ["wcf-rules"], builtIn: true },
|
|
52
|
+
{ id: "curling-canada", family: "curling", name: { en: "Curling Canada sheet", ja: "カーリング・カナダのシート" }, unit: "ft", dimensions: CURLING_CANADA_SHEET, sources: ["curling-canada-rules"] },
|
|
53
|
+
];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Unit } from "../units.ts";
|
|
2
|
+
import { type Span } from "./fields.ts";
|
|
3
|
+
import { type LeagueBase } from "./types.ts";
|
|
4
|
+
/** The figures of the pitch, in the unit of the table they are in. */
|
|
5
|
+
export interface FieldHockeyFigures {
|
|
6
|
+
length: Span;
|
|
7
|
+
width: Span;
|
|
8
|
+
/** The width of the lines. */
|
|
9
|
+
lineWidth: number;
|
|
10
|
+
/** The distance from the back-line to the 22.90 m lines (the 23-metre lines), edge to edge. */
|
|
11
|
+
twentyThree: number;
|
|
12
|
+
/** The goal-posts' inside distance, the height under the crossbar, and the net's depth at the ground (the least the rules allow). */
|
|
13
|
+
goalWidth: number;
|
|
14
|
+
goalHeight: number;
|
|
15
|
+
goalDepth: number;
|
|
16
|
+
/** The circle: the straight line's length, and the distance from the back-line to its outside edge (the quarter-circles' radius). */
|
|
17
|
+
circleLine: number;
|
|
18
|
+
circleRadius: number;
|
|
19
|
+
/** The broken line outside the circle: its distance from the circle (outer edges), the length of each solid section and of each gap. */
|
|
20
|
+
broken: {
|
|
21
|
+
outside: number;
|
|
22
|
+
solid: number;
|
|
23
|
+
gap: number;
|
|
24
|
+
};
|
|
25
|
+
/** The penalty spot's diameter, and its centre's distance from the inner edge of the goal-line. */
|
|
26
|
+
spot: number;
|
|
27
|
+
spotFrom: number;
|
|
28
|
+
/** The marks outside the pitch: their length, their distance from the goal-post on the back-lines (the corner marks at 5 and 10 m). */
|
|
29
|
+
mark: number;
|
|
30
|
+
cornerMarks: number[];
|
|
31
|
+
/** The flag-posts' height (at least). */
|
|
32
|
+
flag: number;
|
|
33
|
+
}
|
|
34
|
+
/** The pitch as the drawing wants it: the figures with every length in feet. */
|
|
35
|
+
export type FieldHockeySpec = FieldHockeyFigures;
|
|
36
|
+
/** The pitch's figures in feet, from the unit the rules give them in. */
|
|
37
|
+
export declare const fieldHockeyInFeet: (figures: FieldHockeyFigures, unit: Unit) => FieldHockeySpec;
|
|
38
|
+
/** A league with a hockey pitch of its own. */
|
|
39
|
+
export type FieldHockeyLeague = LeagueBase<"fieldhockey", FieldHockeyFigures>;
|
|
40
|
+
/**
|
|
41
|
+
* The FIH's pitch, from the Rules of Hockey (effective 1 March 2026), Field and Equipment Specifications 1.1 to 1.8: 91.40 by 55.00 m; lines 75 mm; the 22.90 m lines (1.3e); the circle (1.4): a 3.66 m
|
|
42
|
+
* line whose outside edge is 14.63 m from the back-line, continued by quarter-circles centred on the inside front corners of the posts; the broken line 5 m outside it, solid sections of 300 mm and gaps of 3 m
|
|
43
|
+
* (1.4d); the penalty spot 150 mm across, its centre 6.40 m from the inner edge of the goal-line (Rule 1; 6.475 m from the outer edge, 1.3i); the goal 3.66 m between the posts and 2.14 m under the crossbar
|
|
44
|
+
* (1.5d), its net at least 1.20 m deep at the ground (1.5e); marks of 300 mm outside the pitch at 5 and 10 m from the goal-posts (1.3g); flag-posts of 1.20 to 1.50 m (1.8).
|
|
45
|
+
*/
|
|
46
|
+
export declare const FIH_PITCH: FieldHockeyFigures;
|
|
47
|
+
/** The field hockey leagues. */
|
|
48
|
+
export declare const FIELD_HOCKEY_LEAGUES: readonly FieldHockeyLeague[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { fixed } from "./fields.js";
|
|
2
|
+
import { inFeet } from "./types.js";
|
|
3
|
+
/** The pitch's figures in feet, from the unit the rules give them in. */
|
|
4
|
+
export const fieldHockeyInFeet = (figures, unit) => inFeet(figures, unit);
|
|
5
|
+
/**
|
|
6
|
+
* The FIH's pitch, from the Rules of Hockey (effective 1 March 2026), Field and Equipment Specifications 1.1 to 1.8: 91.40 by 55.00 m; lines 75 mm; the 22.90 m lines (1.3e); the circle (1.4): a 3.66 m
|
|
7
|
+
* line whose outside edge is 14.63 m from the back-line, continued by quarter-circles centred on the inside front corners of the posts; the broken line 5 m outside it, solid sections of 300 mm and gaps of 3 m
|
|
8
|
+
* (1.4d); the penalty spot 150 mm across, its centre 6.40 m from the inner edge of the goal-line (Rule 1; 6.475 m from the outer edge, 1.3i); the goal 3.66 m between the posts and 2.14 m under the crossbar
|
|
9
|
+
* (1.5d), its net at least 1.20 m deep at the ground (1.5e); marks of 300 mm outside the pitch at 5 and 10 m from the goal-posts (1.3g); flag-posts of 1.20 to 1.50 m (1.8).
|
|
10
|
+
*/
|
|
11
|
+
export const FIH_PITCH = {
|
|
12
|
+
length: fixed(91.4),
|
|
13
|
+
width: fixed(55),
|
|
14
|
+
lineWidth: 0.075,
|
|
15
|
+
twentyThree: 22.9,
|
|
16
|
+
goalWidth: 3.66,
|
|
17
|
+
goalHeight: 2.14,
|
|
18
|
+
goalDepth: 1.2,
|
|
19
|
+
circleLine: 3.66,
|
|
20
|
+
circleRadius: 14.63,
|
|
21
|
+
broken: { outside: 5, solid: 0.3, gap: 3 },
|
|
22
|
+
spot: 0.15,
|
|
23
|
+
spotFrom: 6.4,
|
|
24
|
+
mark: 0.3,
|
|
25
|
+
cornerMarks: [5, 10],
|
|
26
|
+
flag: 1.2,
|
|
27
|
+
};
|
|
28
|
+
/** The field hockey leagues. */
|
|
29
|
+
export const FIELD_HOCKEY_LEAGUES = [{ id: "fih", family: "fieldhockey", name: { en: "FIH hockey pitch", ja: "FIHのフィールドホッケーのピッチ" }, unit: "m", dimensions: FIH_PITCH, sources: ["fih-rules"], builtIn: true }];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A length the rules allow between a least and a greatest, with the one that is drawn, all in the league's unit. */
|
|
2
|
+
export interface Span {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
drawn: number;
|
|
6
|
+
}
|
|
7
|
+
/** A range of sizes; the drawn size is the greatest the rules allow unless another is said. */
|
|
8
|
+
export declare const span: (min: number, max: number, drawn?: number) => Span;
|
|
9
|
+
/** A size the rules fix: a range of one. */
|
|
10
|
+
export declare const fixed: (value: number) => Span;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// What the field sports' leagues share: a size a rulebook allows as a range, with the size that is drawn. The figures of each sport are in its own file
|
|
2
|
+
// (rugby.ts, lacrosse.ts, aussie.ts, gaelic.ts, cricket.ts, fieldhockey.ts, handball.ts), in the unit its rulebook prints first. Nothing here draws.
|
|
3
|
+
/** A range of sizes; the drawn size is the greatest the rules allow unless another is said. */
|
|
4
|
+
export const span = (min, max, drawn = max) => ({ min, max, drawn });
|
|
5
|
+
/** A size the rules fix: a range of one. */
|
|
6
|
+
export const fixed = (value) => ({ min: value, max: value, drawn: value });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FootballSpec } from "../geometry.ts";
|
|
2
|
+
import type { LeagueBase } from "./types.ts";
|
|
3
|
+
/** The figures of a football field: a `FootballSpec`, every length in feet. */
|
|
4
|
+
export type FootballFigures = FootballSpec;
|
|
5
|
+
/** A league with a football field of its own. */
|
|
6
|
+
export type FootballLeague = LeagueBase<"football", FootballFigures>;
|
|
7
|
+
/** The football leagues: the NFL, the CFL and the IFAF first. */
|
|
8
|
+
export declare const FOOTBALL_LEAGUES: readonly FootballLeague[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// The football fields: the NFL's, the CFL's and the IFAF's, which the package started with, and each league or association that
|
|
2
|
+
// marks its field differently. A field's figures are kept in feet, as `FOOTBALL` has them; its size is written in yards.
|
|
3
|
+
import { FOOTBALL, inch } from "../geometry.js";
|
|
4
|
+
const yd = (n) => n * 3;
|
|
5
|
+
/** Four inches: the width the rules give the field's lines, and so the boundary band. */
|
|
6
|
+
const FOUR_INCHES = inch(4);
|
|
7
|
+
/** The football leagues: the NFL, the CFL and the IFAF first. */
|
|
8
|
+
export const FOOTBALL_LEAGUES = [
|
|
9
|
+
{ id: "nfl", family: "football", name: { en: "NFL football field", ja: "NFLのフィールド" }, unit: "yd", figuresUnit: "ft", dimensions: FOOTBALL.nfl, sources: ["nfl-rules"], builtIn: true },
|
|
10
|
+
{ id: "cfl", family: "football", name: { en: "CFL football field", ja: "CFLのフィールド" }, unit: "yd", figuresUnit: "ft", dimensions: FOOTBALL.cfl, sources: ["cfl-rules"], builtIn: true },
|
|
11
|
+
{ id: "ifaf", family: "football", name: { en: "IFAF football field", ja: "IFAFのフィールド" }, unit: "yd", figuresUnit: "ft", dimensions: FOOTBALL.ifaf, sources: ["ifaf-2021"], builtIn: true },
|
|
12
|
+
{
|
|
13
|
+
id: "ncaa",
|
|
14
|
+
family: "football",
|
|
15
|
+
name: { en: "NCAA football field", ja: "NCAAのフィールド" },
|
|
16
|
+
unit: "yd",
|
|
17
|
+
figuresUnit: "ft",
|
|
18
|
+
// Rules 1-2 and 2-12 and Appendix D of the NCAA Football Rules and Interpretations: 100 yards between the goal lines, 10-yard end zones, 160 feet wide, the hash marks 60 feet from each sideline, the numbers' tops 9 yards from it, 6 feet high, the posts on the end line 18 feet 6 in apart.
|
|
19
|
+
dimensions: { id: "nfl", name: "NCAA field", length: yd(100), endZone: yd(10), width: 160, hash: 60, boundary: FOUR_INCHES, numbers: [21, 27], posts: "end-line", centre: "50", yardLine: yd(5), postWidth: 18.5 },
|
|
20
|
+
sources: ["ncaa-football"],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "nfhs",
|
|
24
|
+
family: "football",
|
|
25
|
+
name: { en: "High school (NFHS) football field, 11 players", ja: "全米高校連盟(NFHS)の11人制フィールド" },
|
|
26
|
+
unit: "yd",
|
|
27
|
+
figuresUnit: "ft",
|
|
28
|
+
// Rules 1-1-2, 1-2-3 and 1-2-5 of the NFHS Football Rules: 360 by 160 feet, the hash marks 53 feet 4 inches from each sideline (in thirds), the numbers' tops 9 yards from it, the posts 23 feet 4 inches apart.
|
|
29
|
+
dimensions: { id: "nfl", name: "NFHS field", length: yd(100), endZone: yd(10), width: 160, hash: 53 + 4 / 12, boundary: FOUR_INCHES, numbers: [21, 27], posts: "end-line", centre: "50", yardLine: yd(5), postWidth: 23 + 4 / 12 },
|
|
30
|
+
sources: ["nfhs-football", "nfhs-diagrams"],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "nfhs-9",
|
|
34
|
+
family: "football",
|
|
35
|
+
name: { en: "High school (NFHS) football field, 9 players", ja: "全米高校連盟(NFHS)の9人制フィールド" },
|
|
36
|
+
unit: "yd",
|
|
37
|
+
figuresUnit: "ft",
|
|
38
|
+
// The NFHS nine-player field diagram: 80 yards between the goal lines and 40 wide, hash marks 48 feet 4 inches from each sideline, the numbers' tops 7 yards from it.
|
|
39
|
+
dimensions: { id: "nfl", name: "NFHS nine-player field", length: yd(80), endZone: yd(10), width: yd(40), hash: 48 + 4 / 12, boundary: FOUR_INCHES, numbers: [15, 21], posts: "end-line", centre: "40", yardLine: yd(5), postWidth: 23 + 4 / 12 },
|
|
40
|
+
sources: ["nfhs-diagrams", "nfhs-football"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "nfhs-8",
|
|
44
|
+
family: "football",
|
|
45
|
+
name: { en: "High school (NFHS) football field, 8 players", ja: "全米高校連盟(NFHS)の8人制フィールド" },
|
|
46
|
+
unit: "yd",
|
|
47
|
+
figuresUnit: "ft",
|
|
48
|
+
// The NFHS eight- and six-player field diagram: 80 yards between the goal lines and 40 wide, hash marks 45 feet from each sideline, the numbers' tops 7 yards from it.
|
|
49
|
+
dimensions: { id: "nfl", name: "NFHS eight-player field", length: yd(80), endZone: yd(10), width: yd(40), hash: 45, boundary: FOUR_INCHES, numbers: [15, 21], posts: "end-line", centre: "40", yardLine: yd(5), postWidth: 23 + 4 / 12 },
|
|
50
|
+
sources: ["nfhs-diagrams", "nfhs-football", "nsaa-eight"],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "nfhs-6",
|
|
54
|
+
family: "football",
|
|
55
|
+
name: { en: "High school (NFHS) football field, 6 players", ja: "全米高校連盟(NFHS)の6人制フィールド" },
|
|
56
|
+
unit: "yd",
|
|
57
|
+
figuresUnit: "ft",
|
|
58
|
+
// The same diagram as the eight-player field.
|
|
59
|
+
dimensions: { id: "nfl", name: "NFHS six-player field", length: yd(80), endZone: yd(10), width: yd(40), hash: 45, boundary: FOUR_INCHES, numbers: [15, 21], posts: "end-line", centre: "40", yardLine: yd(5), postWidth: 23 + 4 / 12 },
|
|
60
|
+
sources: ["nfhs-diagrams", "nfhs-football"],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "uil-6",
|
|
64
|
+
family: "football",
|
|
65
|
+
name: { en: "Texas (UIL) six-man football field", ja: "テキサス州(UIL)の6人制フィールド" },
|
|
66
|
+
unit: "yd",
|
|
67
|
+
figuresUnit: "ft",
|
|
68
|
+
// Exceptions to the NCAA rules in the UIL's six-player rules: 80 by 40 yards, the hash marks 40 feet from each sideline, goal posts 25 feet apart. The end zones, the numbers and the posts' place are the NCAA's.
|
|
69
|
+
dimensions: { id: "nfl", name: "UIL six-man field", length: yd(80), endZone: yd(10), width: yd(40), hash: 40, boundary: FOUR_INCHES, numbers: [21, 27], posts: "end-line", centre: "40", yardLine: yd(5), postWidth: 25 },
|
|
70
|
+
sources: ["uil-six", "ncaa-football"],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "ifl",
|
|
74
|
+
family: "football",
|
|
75
|
+
name: { en: "Indoor Football League field", ja: "インドア・フットボール・リーグ(IFL)のフィールド" },
|
|
76
|
+
unit: "yd",
|
|
77
|
+
figuresUnit: "ft",
|
|
78
|
+
// Rule 1 of the 2024 IFL Rule Book: 50 by 28 yards with 8-yard end zones inside padded walls, the wide set of hash marks 30 feet apart (so 27 feet from each wall), posts centred on the end line 10 feet apart; no yard numbers are named.
|
|
79
|
+
dimensions: { id: "nfl", name: "IFL field", length: yd(50), endZone: yd(8), width: yd(28), hash: 27, boundary: FOUR_INCHES, numbers: [21, 27], noNumbers: true, pylons: false, posts: "end-line", centre: "25", yardLine: yd(5), postWidth: 10 },
|
|
80
|
+
sources: ["ifl-2024"],
|
|
81
|
+
},
|
|
82
|
+
];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Unit } from "../units.ts";
|
|
2
|
+
import { type Span } from "./fields.ts";
|
|
3
|
+
import { type LeagueBase } from "./types.ts";
|
|
4
|
+
/** The figures of the field, in the unit of the table they are in. `null` is what a code does not have. */
|
|
5
|
+
export interface GaelicFigures {
|
|
6
|
+
/** `football` or `hurling`. */
|
|
7
|
+
code: "football" | "hurling";
|
|
8
|
+
/** End line to end line, and across; the size drawn is the greatest. */
|
|
9
|
+
length: Span;
|
|
10
|
+
width: Span;
|
|
11
|
+
/** The lines across the field, in metres from each end line: 13, 20, 45 and, for hurling, 65. */
|
|
12
|
+
lines: number[];
|
|
13
|
+
/** The posts' distance apart and the crossbar's height above the ground. */
|
|
14
|
+
postsApart: number;
|
|
15
|
+
crossbar: number;
|
|
16
|
+
/** The small rectangle (14 by 4.5 m) and the large one (19 by 13 m): how far each side line stands outside a post's inside edge, and how deep it is. */
|
|
17
|
+
small: {
|
|
18
|
+
outside: number;
|
|
19
|
+
depth: number;
|
|
20
|
+
};
|
|
21
|
+
large: {
|
|
22
|
+
outside: number;
|
|
23
|
+
depth: number;
|
|
24
|
+
};
|
|
25
|
+
/** The radius of the arc on the 20 m line (centred on its middle), the radius of the football arc centred on the middle of the goal line, and the penalty point's distance from it. */
|
|
26
|
+
arc: number;
|
|
27
|
+
footballArc: number | null;
|
|
28
|
+
penaltyPoint: number | null;
|
|
29
|
+
/** The half-way line: the length of the solid midline, and the length of the dashes marked out from it at intervals of the same length across the field. */
|
|
30
|
+
midline: number;
|
|
31
|
+
dash: number;
|
|
32
|
+
/** The width of the lines. */
|
|
33
|
+
lineWidth: number;
|
|
34
|
+
}
|
|
35
|
+
/** The field as the drawing wants it: the figures with every length in feet. */
|
|
36
|
+
export type GaelicSpec = GaelicFigures;
|
|
37
|
+
/** The field's figures in feet, from the unit the Guide gives them in. */
|
|
38
|
+
export declare const gaelicInFeet: (figures: GaelicFigures, unit: Unit) => GaelicSpec;
|
|
39
|
+
/** A league with a Gaelic field of its own. */
|
|
40
|
+
export type GaelicLeague = LeagueBase<"gaelic", GaelicFigures>;
|
|
41
|
+
/**
|
|
42
|
+
* The field for Gaelic football, from Rule 1 of the Official Guide Part 2 (effective 27 March 2026): 130 to 145 m by 80 to 90 m; lines across at 13, 20 and 45 m from each end line; the posts
|
|
43
|
+
* 6.5 m apart on the end line, the crossbar 2.5 m up; the small rectangle 14 by 4.5 m (its sides 3.75 m outside the posts' inside edges) and the large one 19 by 13 m (6.25 m); a 13 m arc on
|
|
44
|
+
* each 20 m line; for football, a 40 m arc centred on the middle of the goal line and the penalty point 11 m from it; the 10 m midline with dashes of 5 m at intervals of 5 m; lines 90 mm wide.
|
|
45
|
+
*/
|
|
46
|
+
export declare const GAA_FOOTBALL_FIELD: GaelicFigures;
|
|
47
|
+
/** The field for hurling, the same field: the 65 m lines (marked "Hurling") and no football arc or penalty point. */
|
|
48
|
+
export declare const GAA_HURLING_FIELD: GaelicFigures;
|
|
49
|
+
/** The Gaelic leagues, football first. */
|
|
50
|
+
export declare const GAELIC_LEAGUES: readonly GaelicLeague[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { span } from "./fields.js";
|
|
2
|
+
import { inFeet } from "./types.js";
|
|
3
|
+
/** The field's figures in feet, from the unit the Guide gives them in. */
|
|
4
|
+
export const gaelicInFeet = (figures, unit) => inFeet(figures, unit);
|
|
5
|
+
const common = {
|
|
6
|
+
length: span(130, 145),
|
|
7
|
+
width: span(80, 90),
|
|
8
|
+
postsApart: 6.5,
|
|
9
|
+
crossbar: 2.5,
|
|
10
|
+
small: { outside: 3.75, depth: 4.5 },
|
|
11
|
+
large: { outside: 6.25, depth: 13 },
|
|
12
|
+
arc: 13,
|
|
13
|
+
midline: 10,
|
|
14
|
+
dash: 5,
|
|
15
|
+
lineWidth: 0.09,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The field for Gaelic football, from Rule 1 of the Official Guide Part 2 (effective 27 March 2026): 130 to 145 m by 80 to 90 m; lines across at 13, 20 and 45 m from each end line; the posts
|
|
19
|
+
* 6.5 m apart on the end line, the crossbar 2.5 m up; the small rectangle 14 by 4.5 m (its sides 3.75 m outside the posts' inside edges) and the large one 19 by 13 m (6.25 m); a 13 m arc on
|
|
20
|
+
* each 20 m line; for football, a 40 m arc centred on the middle of the goal line and the penalty point 11 m from it; the 10 m midline with dashes of 5 m at intervals of 5 m; lines 90 mm wide.
|
|
21
|
+
*/
|
|
22
|
+
export const GAA_FOOTBALL_FIELD = { code: "football", ...common, lines: [13, 20, 45], footballArc: 40, penaltyPoint: 11 };
|
|
23
|
+
/** The field for hurling, the same field: the 65 m lines (marked "Hurling") and no football arc or penalty point. */
|
|
24
|
+
export const GAA_HURLING_FIELD = { code: "hurling", ...common, lines: [13, 20, 45, 65], footballArc: null, penaltyPoint: null };
|
|
25
|
+
/** The Gaelic leagues, football first. */
|
|
26
|
+
export const GAELIC_LEAGUES = [
|
|
27
|
+
{ id: "gaa-football", family: "gaelic", name: { en: "GAA field for Gaelic football", ja: "GAAのゲーリック・フットボールのフィールド" }, unit: "m", dimensions: GAA_FOOTBALL_FIELD, sources: ["gaa-guide"], builtIn: true },
|
|
28
|
+
{ id: "gaa-hurling", family: "gaelic", name: { en: "GAA field for hurling", ja: "GAAのハーリングのフィールド" }, unit: "m", dimensions: GAA_HURLING_FIELD, sources: ["gaa-guide"] },
|
|
29
|
+
];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Unit } from "../units.ts";
|
|
2
|
+
import { type Span } from "./fields.ts";
|
|
3
|
+
import { type LeagueBase } from "./types.ts";
|
|
4
|
+
/** The figures of the court, in the unit of the table they are in. */
|
|
5
|
+
export interface HandballFigures {
|
|
6
|
+
length: Span;
|
|
7
|
+
width: Span;
|
|
8
|
+
/** The goal: inside width and height, and the depth of its net behind the goal line (at the ground). */
|
|
9
|
+
goalWidth: number;
|
|
10
|
+
goalHeight: number;
|
|
11
|
+
goalDepth: number;
|
|
12
|
+
/** The goal-area line (6 m): its straight part's length, and its distance from the rear edge of the goal line to its front edge; the arcs' radius is that distance. */
|
|
13
|
+
areaLine: number;
|
|
14
|
+
areaDistance: number;
|
|
15
|
+
/** The free-throw line (9 m): its distance outside the goal-area line, and the length of each segment and each space (15 cm). */
|
|
16
|
+
freeThrowOutside: number;
|
|
17
|
+
freeThrowDash: number;
|
|
18
|
+
/** The 7-metre line: its length and its front edge's distance from the goal line; the 4-metre line likewise. */
|
|
19
|
+
sevenLine: number;
|
|
20
|
+
sevenDistance: number;
|
|
21
|
+
fourLine: number;
|
|
22
|
+
fourDistance: number;
|
|
23
|
+
/** The throw-off area's diameter, the substitution line's length from the centre line and the mark that ends it (inside and outside the side line). */
|
|
24
|
+
throwOff: number;
|
|
25
|
+
substitution: number;
|
|
26
|
+
substitutionMark: number;
|
|
27
|
+
/** The width of the lines, and of the goal line between the posts. */
|
|
28
|
+
lineWidth: number;
|
|
29
|
+
goalLineWidth: number;
|
|
30
|
+
}
|
|
31
|
+
/** The court as the drawing wants it: the figures with every length in feet. */
|
|
32
|
+
export type HandballSpec = HandballFigures;
|
|
33
|
+
/** The court's figures in feet, from the unit the rules give them in. */
|
|
34
|
+
export declare const handballInFeet: (figures: HandballFigures, unit: Unit) => HandballSpec;
|
|
35
|
+
/** A league with a handball court of its own. */
|
|
36
|
+
export type HandballLeague = LeagueBase<"handball", HandballFigures>;
|
|
37
|
+
/**
|
|
38
|
+
* The IHF's court, from Rule 1 of the Rules of the Game for Indoor Handball (1 July 2025): 40 by 20 m (1:1); the goal 3 m wide and 2 m high (1:2); lines 5 cm, the goal line between the posts 8 cm (1:3); the
|
|
39
|
+
* goal-area line a 3 m line 6 m from the goal line with quarter circles of 6 m about the posts' rear inner corners (1:4); the free-throw line broken, 3 m outside it, segments and spaces of 15 cm (1:5); the 7-metre line 1 m
|
|
40
|
+
* long (1:6); the 4-metre line 15 cm long (1:7); the throw-off area 4 m across (1:9); the substitution line 4.5 m from the centre line, ended by a mark 15 cm either side of the side line (1:10). The net's 1.1 m
|
|
41
|
+
* depth at the ground is from the Guidelines for Playing Courts and Goals (V h), which are not part of the rules.
|
|
42
|
+
*/
|
|
43
|
+
export declare const IHF_COURT: HandballFigures;
|
|
44
|
+
/** The handball leagues. */
|
|
45
|
+
export declare const HANDBALL_LEAGUES: readonly HandballLeague[];
|