@rickosborne/hexgrid 2025.5.31

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.
Files changed (344) hide show
  1. package/README.md +2141 -0
  2. package/axial-add.cjs +30 -0
  3. package/axial-add.cjs.map +6 -0
  4. package/axial-add.d.ts +6 -0
  5. package/axial-add.d.ts.map +1 -0
  6. package/axial-add.mjs +11 -0
  7. package/axial-add.mjs.map +6 -0
  8. package/axial-from-cube.cjs +33 -0
  9. package/axial-from-cube.cjs.map +6 -0
  10. package/axial-from-cube.d.ts +7 -0
  11. package/axial-from-cube.d.ts.map +1 -0
  12. package/axial-from-cube.mjs +14 -0
  13. package/axial-from-cube.mjs.map +6 -0
  14. package/axial-from-double.cjs +30 -0
  15. package/axial-from-double.cjs.map +6 -0
  16. package/axial-from-double.d.ts +5 -0
  17. package/axial-from-double.d.ts.map +1 -0
  18. package/axial-from-double.mjs +11 -0
  19. package/axial-from-double.mjs.map +6 -0
  20. package/axial-from-offset.cjs +64 -0
  21. package/axial-from-offset.cjs.map +6 -0
  22. package/axial-from-offset.d.ts +4 -0
  23. package/axial-from-offset.d.ts.map +1 -0
  24. package/axial-from-offset.mjs +45 -0
  25. package/axial-from-offset.mjs.map +6 -0
  26. package/axial-intersection.cjs +28 -0
  27. package/axial-intersection.cjs.map +6 -0
  28. package/axial-intersection.d.ts +3 -0
  29. package/axial-intersection.d.ts.map +1 -0
  30. package/axial-intersection.mjs +9 -0
  31. package/axial-intersection.mjs.map +6 -0
  32. package/axial-lerp.cjs +32 -0
  33. package/axial-lerp.cjs.map +6 -0
  34. package/axial-lerp.d.ts +3 -0
  35. package/axial-lerp.d.ts.map +1 -0
  36. package/axial-lerp.mjs +13 -0
  37. package/axial-lerp.mjs.map +6 -0
  38. package/axial-line-draw.cjs +39 -0
  39. package/axial-line-draw.cjs.map +6 -0
  40. package/axial-line-draw.d.ts +3 -0
  41. package/axial-line-draw.d.ts.map +1 -0
  42. package/axial-line-draw.mjs +20 -0
  43. package/axial-line-draw.mjs.map +6 -0
  44. package/axial-neighbor.cjs +27 -0
  45. package/axial-neighbor.cjs.map +6 -0
  46. package/axial-neighbor.d.ts +3 -0
  47. package/axial-neighbor.d.ts.map +1 -0
  48. package/axial-neighbor.mjs +8 -0
  49. package/axial-neighbor.mjs.map +6 -0
  50. package/axial-range.cjs +29 -0
  51. package/axial-range.cjs.map +6 -0
  52. package/axial-range.d.ts +3 -0
  53. package/axial-range.d.ts.map +1 -0
  54. package/axial-range.mjs +10 -0
  55. package/axial-range.mjs.map +6 -0
  56. package/axial-round.cjs +31 -0
  57. package/axial-round.cjs.map +6 -0
  58. package/axial-round.d.ts +3 -0
  59. package/axial-round.d.ts.map +1 -0
  60. package/axial-round.mjs +12 -0
  61. package/axial-round.mjs.map +6 -0
  62. package/axial-subtract.cjs +28 -0
  63. package/axial-subtract.cjs.map +6 -0
  64. package/axial-subtract.d.ts +6 -0
  65. package/axial-subtract.d.ts.map +1 -0
  66. package/axial-subtract.mjs +9 -0
  67. package/axial-subtract.mjs.map +6 -0
  68. package/axial.cjs +66 -0
  69. package/axial.cjs.map +6 -0
  70. package/axial.d.ts +83 -0
  71. package/axial.d.ts.map +1 -0
  72. package/axial.mjs +47 -0
  73. package/axial.mjs.map +6 -0
  74. package/covering-grid.cjs +78 -0
  75. package/covering-grid.cjs.map +6 -0
  76. package/covering-grid.d.ts +20 -0
  77. package/covering-grid.d.ts.map +1 -0
  78. package/covering-grid.mjs +59 -0
  79. package/covering-grid.mjs.map +6 -0
  80. package/cube-add.cjs +32 -0
  81. package/cube-add.cjs.map +6 -0
  82. package/cube-add.d.ts +6 -0
  83. package/cube-add.d.ts.map +1 -0
  84. package/cube-add.mjs +13 -0
  85. package/cube-add.mjs.map +6 -0
  86. package/cube-distance.cjs +30 -0
  87. package/cube-distance.cjs.map +6 -0
  88. package/cube-distance.d.ts +6 -0
  89. package/cube-distance.d.ts.map +1 -0
  90. package/cube-distance.mjs +11 -0
  91. package/cube-distance.mjs.map +6 -0
  92. package/cube-from-axial.cjs +34 -0
  93. package/cube-from-axial.cjs.map +6 -0
  94. package/cube-from-axial.d.ts +7 -0
  95. package/cube-from-axial.d.ts.map +1 -0
  96. package/cube-from-axial.mjs +15 -0
  97. package/cube-from-axial.mjs.map +6 -0
  98. package/cube-from-double.cjs +30 -0
  99. package/cube-from-double.cjs.map +6 -0
  100. package/cube-from-double.d.ts +5 -0
  101. package/cube-from-double.d.ts.map +1 -0
  102. package/cube-from-double.mjs +11 -0
  103. package/cube-from-double.mjs.map +6 -0
  104. package/cube-heading.cjs +54 -0
  105. package/cube-heading.cjs.map +6 -0
  106. package/cube-heading.d.ts +3 -0
  107. package/cube-heading.d.ts.map +1 -0
  108. package/cube-heading.mjs +35 -0
  109. package/cube-heading.mjs.map +6 -0
  110. package/cube-intersection.cjs +28 -0
  111. package/cube-intersection.cjs.map +6 -0
  112. package/cube-intersection.d.ts +3 -0
  113. package/cube-intersection.d.ts.map +1 -0
  114. package/cube-intersection.mjs +9 -0
  115. package/cube-intersection.mjs.map +6 -0
  116. package/cube-lerp.cjs +34 -0
  117. package/cube-lerp.cjs.map +6 -0
  118. package/cube-lerp.d.ts +3 -0
  119. package/cube-lerp.d.ts.map +1 -0
  120. package/cube-lerp.mjs +15 -0
  121. package/cube-lerp.mjs.map +6 -0
  122. package/cube-line-draw.cjs +41 -0
  123. package/cube-line-draw.cjs.map +6 -0
  124. package/cube-line-draw.d.ts +3 -0
  125. package/cube-line-draw.d.ts.map +1 -0
  126. package/cube-line-draw.mjs +22 -0
  127. package/cube-line-draw.mjs.map +6 -0
  128. package/cube-neighbor.cjs +27 -0
  129. package/cube-neighbor.cjs.map +6 -0
  130. package/cube-neighbor.d.ts +6 -0
  131. package/cube-neighbor.d.ts.map +1 -0
  132. package/cube-neighbor.mjs +8 -0
  133. package/cube-neighbor.mjs.map +6 -0
  134. package/cube-range.cjs +29 -0
  135. package/cube-range.cjs.map +6 -0
  136. package/cube-range.d.ts +3 -0
  137. package/cube-range.d.ts.map +1 -0
  138. package/cube-range.mjs +10 -0
  139. package/cube-range.mjs.map +6 -0
  140. package/cube-rotate.cjs +40 -0
  141. package/cube-rotate.cjs.map +6 -0
  142. package/cube-rotate.d.ts +4 -0
  143. package/cube-rotate.d.ts.map +1 -0
  144. package/cube-rotate.mjs +21 -0
  145. package/cube-rotate.mjs.map +6 -0
  146. package/cube-round.cjs +46 -0
  147. package/cube-round.cjs.map +6 -0
  148. package/cube-round.d.ts +3 -0
  149. package/cube-round.d.ts.map +1 -0
  150. package/cube-round.mjs +27 -0
  151. package/cube-round.mjs.map +6 -0
  152. package/cube-subtract.cjs +33 -0
  153. package/cube-subtract.cjs.map +6 -0
  154. package/cube-subtract.d.ts +3 -0
  155. package/cube-subtract.d.ts.map +1 -0
  156. package/cube-subtract.mjs +14 -0
  157. package/cube-subtract.mjs.map +6 -0
  158. package/cube.cjs +82 -0
  159. package/cube.cjs.map +6 -0
  160. package/cube.d.ts +155 -0
  161. package/cube.d.ts.map +1 -0
  162. package/cube.mjs +63 -0
  163. package/cube.mjs.map +6 -0
  164. package/double-add.cjs +37 -0
  165. package/double-add.cjs.map +6 -0
  166. package/double-add.d.ts +4 -0
  167. package/double-add.d.ts.map +1 -0
  168. package/double-add.mjs +18 -0
  169. package/double-add.mjs.map +6 -0
  170. package/double-distance.cjs +36 -0
  171. package/double-distance.cjs.map +6 -0
  172. package/double-distance.d.ts +4 -0
  173. package/double-distance.d.ts.map +1 -0
  174. package/double-distance.mjs +17 -0
  175. package/double-distance.mjs.map +6 -0
  176. package/double-from-qrs.cjs +37 -0
  177. package/double-from-qrs.cjs.map +6 -0
  178. package/double-from-qrs.d.ts +5 -0
  179. package/double-from-qrs.d.ts.map +1 -0
  180. package/double-from-qrs.mjs +18 -0
  181. package/double-from-qrs.mjs.map +6 -0
  182. package/double-neighbor.cjs +29 -0
  183. package/double-neighbor.cjs.map +6 -0
  184. package/double-neighbor.d.ts +4 -0
  185. package/double-neighbor.d.ts.map +1 -0
  186. package/double-neighbor.mjs +10 -0
  187. package/double-neighbor.mjs.map +6 -0
  188. package/double.cjs +48 -0
  189. package/double.cjs.map +6 -0
  190. package/double.d.ts +77 -0
  191. package/double.d.ts.map +1 -0
  192. package/double.mjs +28 -0
  193. package/double.mjs.map +6 -0
  194. package/hex-contains-point.cjs +99 -0
  195. package/hex-contains-point.cjs.map +6 -0
  196. package/hex-contains-point.d.ts +16 -0
  197. package/hex-contains-point.d.ts.map +1 -0
  198. package/hex-contains-point.mjs +80 -0
  199. package/hex-contains-point.mjs.map +6 -0
  200. package/hex-distance.cjs +36 -0
  201. package/hex-distance.cjs.map +6 -0
  202. package/hex-distance.d.ts +11 -0
  203. package/hex-distance.d.ts.map +1 -0
  204. package/hex-distance.mjs +17 -0
  205. package/hex-distance.mjs.map +6 -0
  206. package/hex-reachable.cjs +55 -0
  207. package/hex-reachable.cjs.map +6 -0
  208. package/hex-reachable.d.ts +14 -0
  209. package/hex-reachable.d.ts.map +1 -0
  210. package/hex-reachable.mjs +36 -0
  211. package/hex-reachable.mjs.map +6 -0
  212. package/hex-system.cjs +78 -0
  213. package/hex-system.cjs.map +6 -0
  214. package/hex-system.d.ts +44 -0
  215. package/hex-system.d.ts.map +1 -0
  216. package/hex-system.mjs +58 -0
  217. package/hex-system.mjs.map +6 -0
  218. package/hexes-within.cjs +31 -0
  219. package/hexes-within.cjs.map +6 -0
  220. package/hexes-within.d.ts +6 -0
  221. package/hexes-within.d.ts.map +1 -0
  222. package/hexes-within.mjs +12 -0
  223. package/hexes-within.mjs.map +6 -0
  224. package/index.cjs +74 -0
  225. package/index.cjs.map +6 -0
  226. package/index.d.ts +57 -0
  227. package/index.d.ts.map +1 -0
  228. package/index.mjs +57 -0
  229. package/index.mjs.map +6 -0
  230. package/lerp.cjs +28 -0
  231. package/lerp.cjs.map +6 -0
  232. package/lerp.d.ts +5 -0
  233. package/lerp.d.ts.map +1 -0
  234. package/lerp.mjs +9 -0
  235. package/lerp.mjs.map +6 -0
  236. package/offset-distance.cjs +33 -0
  237. package/offset-distance.cjs.map +6 -0
  238. package/offset-distance.d.ts +3 -0
  239. package/offset-distance.d.ts.map +1 -0
  240. package/offset-distance.mjs +14 -0
  241. package/offset-distance.mjs.map +6 -0
  242. package/offset-from-qrs.cjs +70 -0
  243. package/offset-from-qrs.cjs.map +6 -0
  244. package/offset-from-qrs.d.ts +7 -0
  245. package/offset-from-qrs.d.ts.map +1 -0
  246. package/offset-from-qrs.mjs +51 -0
  247. package/offset-from-qrs.mjs.map +6 -0
  248. package/offset-neighbor.cjs +54 -0
  249. package/offset-neighbor.cjs.map +6 -0
  250. package/offset-neighbor.d.ts +3 -0
  251. package/offset-neighbor.d.ts.map +1 -0
  252. package/offset-neighbor.mjs +35 -0
  253. package/offset-neighbor.mjs.map +6 -0
  254. package/offset.cjs +61 -0
  255. package/offset.cjs.map +6 -0
  256. package/offset.d.ts +34 -0
  257. package/offset.d.ts.map +1 -0
  258. package/offset.mjs +42 -0
  259. package/offset.mjs.map +6 -0
  260. package/orientation.cjs +54 -0
  261. package/orientation.cjs.map +6 -0
  262. package/orientation.d.ts +36 -0
  263. package/orientation.d.ts.map +1 -0
  264. package/orientation.mjs +34 -0
  265. package/orientation.mjs.map +6 -0
  266. package/package.json +398 -0
  267. package/pixel-from-qrs.cjs +66 -0
  268. package/pixel-from-qrs.cjs.map +6 -0
  269. package/pixel-from-qrs.d.ts +10 -0
  270. package/pixel-from-qrs.d.ts.map +1 -0
  271. package/pixel-from-qrs.mjs +47 -0
  272. package/pixel-from-qrs.mjs.map +6 -0
  273. package/point.cjs +17 -0
  274. package/point.cjs.map +6 -0
  275. package/point.d.ts +5 -0
  276. package/point.d.ts.map +1 -0
  277. package/point.mjs +1 -0
  278. package/point.mjs.map +6 -0
  279. package/qrs-eq.cjs +26 -0
  280. package/qrs-eq.cjs.map +6 -0
  281. package/qrs-eq.d.ts +3 -0
  282. package/qrs-eq.d.ts.map +1 -0
  283. package/qrs-eq.mjs +7 -0
  284. package/qrs-eq.mjs.map +6 -0
  285. package/qrs-from-double.cjs +36 -0
  286. package/qrs-from-double.cjs.map +6 -0
  287. package/qrs-from-double.d.ts +5 -0
  288. package/qrs-from-double.d.ts.map +1 -0
  289. package/qrs-from-double.mjs +17 -0
  290. package/qrs-from-double.mjs.map +6 -0
  291. package/qrs-from-pixel.cjs +50 -0
  292. package/qrs-from-pixel.cjs.map +6 -0
  293. package/qrs-from-pixel.d.ts +12 -0
  294. package/qrs-from-pixel.d.ts.map +1 -0
  295. package/qrs-from-pixel.mjs +31 -0
  296. package/qrs-from-pixel.mjs.map +6 -0
  297. package/qrs-hash-code.cjs +41 -0
  298. package/qrs-hash-code.cjs.map +6 -0
  299. package/qrs-hash-code.d.ts +7 -0
  300. package/qrs-hash-code.d.ts.map +1 -0
  301. package/qrs-hash-code.mjs +22 -0
  302. package/qrs-hash-code.mjs.map +6 -0
  303. package/qrs-intersection.cjs +44 -0
  304. package/qrs-intersection.cjs.map +6 -0
  305. package/qrs-intersection.d.ts +3 -0
  306. package/qrs-intersection.d.ts.map +1 -0
  307. package/qrs-intersection.mjs +25 -0
  308. package/qrs-intersection.mjs.map +6 -0
  309. package/qrs-range.cjs +38 -0
  310. package/qrs-range.cjs.map +6 -0
  311. package/qrs-range.d.ts +6 -0
  312. package/qrs-range.d.ts.map +1 -0
  313. package/qrs-range.mjs +19 -0
  314. package/qrs-range.mjs.map +6 -0
  315. package/qrs-ring.cjs +50 -0
  316. package/qrs-ring.cjs.map +6 -0
  317. package/qrs-ring.d.ts +3 -0
  318. package/qrs-ring.d.ts.map +1 -0
  319. package/qrs-ring.mjs +31 -0
  320. package/qrs-ring.mjs.map +6 -0
  321. package/qrs-scale.cjs +30 -0
  322. package/qrs-scale.cjs.map +6 -0
  323. package/qrs-scale.d.ts +4 -0
  324. package/qrs-scale.d.ts.map +1 -0
  325. package/qrs-scale.mjs +11 -0
  326. package/qrs-scale.mjs.map +6 -0
  327. package/qrs-spiral.cjs +36 -0
  328. package/qrs-spiral.cjs.map +6 -0
  329. package/qrs-spiral.d.ts +3 -0
  330. package/qrs-spiral.d.ts.map +1 -0
  331. package/qrs-spiral.mjs +17 -0
  332. package/qrs-spiral.mjs.map +6 -0
  333. package/qrs-subtract.cjs +31 -0
  334. package/qrs-subtract.cjs.map +6 -0
  335. package/qrs-subtract.d.ts +4 -0
  336. package/qrs-subtract.d.ts.map +1 -0
  337. package/qrs-subtract.mjs +12 -0
  338. package/qrs-subtract.mjs.map +6 -0
  339. package/qrs.cjs +28 -0
  340. package/qrs.cjs.map +6 -0
  341. package/qrs.d.ts +36 -0
  342. package/qrs.d.ts.map +1 -0
  343. package/qrs.mjs +9 -0
  344. package/qrs.mjs.map +6 -0
package/README.md ADDED
@@ -0,0 +1,2141 @@
1
+ # hexgrid
2
+
3
+ Tools for working with hex grid maps and coordinates.
4
+ Based in large part on the writings of [Amit Patel of Red Blob Games](https://www.redblobgames.com/grids/hexagons/).
5
+
6
+ ## Usage
7
+
8
+ Install via your favorite package manager.
9
+
10
+ Each package supports CommonJS `require`, ESM `import`, and TypeScript usage.
11
+
12
+ You also have a choice: barrel imports or direct imports.
13
+
14
+ Barrel imports mean you're going to require/import everything from the same package-level namespace:
15
+
16
+ ```typescript
17
+ // CommonJS
18
+ const { isPlainObject, isListOf } = require("@rickosborne/guard");
19
+ // ESM / TypeScript
20
+ import { isPlainObject, isListOf } from "@rickosborne/guard";
21
+ ```
22
+
23
+ Implications:
24
+
25
+ - Nice and simple.
26
+ - Your build system needs to do tree-shaking well ... or you'll end up adding the entire package even if you only import two functions.
27
+
28
+ The other option is to use direct imports:
29
+
30
+ ```typescript
31
+ // CommonJS
32
+ const { isPlainObject } = require("@rickosborne/guard/is-object");
33
+ const { isListOf } = require("@rickosborne/guard/is-list-of");
34
+ // ESM / TypeScript
35
+ import { isPlainObject } from "@rickosborne/guard/is-object.js";
36
+ import { isListOf } from "@rickosborne/guard/is-list-of.js";
37
+ ```
38
+
39
+ Implications:
40
+
41
+ - You (probably) don't have to worry about tree-shaking as your build (likely) ends up with only the functions you need.
42
+
43
+ If you're using a modern build system, there aren't any strong reasons to prefer one way over the other.
44
+ It's really just down to your personal preference.
45
+
46
+ ### A quick note about file extensions
47
+
48
+ Do you need to use file extensions?
49
+ And if so, which extensions?
50
+
51
+ Honestly ... this is a dumpster fire question.
52
+ It really comes down to your own setup and configuration.
53
+
54
+ Within each package itself:
55
+
56
+ - The CommonJS files all have `.cjs` extensions.
57
+ - The ESM files all have `.mjs` extensions.
58
+ - Node subpath exports have been set up to send `.js` imports to the `.cjs` (via `require`) or `.mjs` (via `import`) files, depending on your setup.
59
+
60
+ So, in theory, the only extension which _won't_ work would be `.ts` because the source isn't included.
61
+
62
+ If you run into a problem with a particular configuration, file a GitHub issue with:
63
+
64
+ - Your `tsconfig.json`'s `module`, `moduleResolution`, and `target` settings.
65
+ - Your `package.json`'s `type` and `imports` settings.
66
+ - An example of another package which imports correctly for you.
67
+
68
+ ## License
69
+
70
+ This package is licensed as [CC-BY-NC-SA-4.0] unless otherwise noted.
71
+ That is, Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.
72
+
73
+ [CC-BY-NC-SA-4.0]: https://creativecommons.org/licenses/by-nc-sa/4.0/
74
+
75
+
76
+ ***
77
+
78
+ ## API
79
+
80
+ ### Functions
81
+
82
+ #### axialAdd
83
+
84
+ <a id="api-axialadd"></a>
85
+
86
+ ```typescript
87
+ axialAdd: (left: AxialPoint, right: AxialPoint) => AxialPoint
88
+ ```
89
+
90
+ Add together two axial points to form a third.
91
+
92
+
93
+ #### axialFromCube
94
+
95
+ <a id="api-axialfromcube"></a>
96
+
97
+ ```typescript
98
+ axialFromCube: (cube: HexCubePoint) => AxialPoint
99
+ ```
100
+
101
+ Rebrand a Cube point to an Axial point.
102
+
103
+
104
+ #### axialFromDoubleHeight
105
+
106
+ <a id="api-axialfromdoubleheight"></a>
107
+
108
+ ```typescript
109
+ axialFromDoubleHeight: (double: DoubleHeightPoint) => AxialPoint
110
+ ```
111
+
112
+ #### axialFromDoubleWidth
113
+
114
+ <a id="api-axialfromdoublewidth"></a>
115
+
116
+ ```typescript
117
+ axialFromDoubleWidth: (double: DoubleWidthPoint) => AxialPoint
118
+ ```
119
+
120
+ #### axialFromOffset
121
+
122
+ <a id="api-axialfromoffset"></a>
123
+
124
+ ```typescript
125
+ axialFromOffset: <S extends OffsetSystem>(offset: OffsetPoint<S>) => AxialPoint
126
+ ```
127
+
128
+ #### axialFromQR
129
+
130
+ <a id="api-axialfromqr"></a>
131
+
132
+ ```typescript
133
+ axialFromQR: (q: number, r: number) => AxialPoint
134
+ ```
135
+
136
+ #### axialIntersection
137
+
138
+ <a id="api-axialintersection"></a>
139
+
140
+ ```typescript
141
+ axialIntersection: (center1: AxialPoint, radius1: number, center2: AxialPoint, radius2?: number) => AxialPoint[]
142
+ ```
143
+
144
+ #### axialLerp
145
+
146
+ <a id="api-axiallerp"></a>
147
+
148
+ ```typescript
149
+ axialLerp: (left: AxialPoint, right: AxialPoint, fraction01: number) => AxialPoint
150
+ ```
151
+
152
+ #### axialLineDraw
153
+
154
+ <a id="api-axiallinedraw"></a>
155
+
156
+ ```typescript
157
+ axialLineDraw: (left: AxialPoint, right: AxialPoint) => AxialPoint[]
158
+ ```
159
+
160
+ #### axialNeighbor
161
+
162
+ <a id="api-axialneighbor"></a>
163
+
164
+ ```typescript
165
+ axialNeighbor: (axial: AxialPoint, direction: AxialDirection) => AxialPoint
166
+ ```
167
+
168
+ #### axialRange
169
+
170
+ <a id="api-axialrange"></a>
171
+
172
+ ```typescript
173
+ axialRange: (center: AxialPoint, radius: number) => AxialPoint[]
174
+ ```
175
+
176
+ #### axialRound
177
+
178
+ <a id="api-axialround"></a>
179
+
180
+ ```typescript
181
+ axialRound: (axial: AxialPoint) => AxialPoint
182
+ ```
183
+
184
+ #### axialSubtract
185
+
186
+ <a id="api-axialsubtract"></a>
187
+
188
+ ```typescript
189
+ axialSubtract: (left: AxialPoint, right: AxialPoint) => AxialPoint
190
+ ```
191
+
192
+ Subtract one axial point from another.
193
+
194
+
195
+ #### bareQRS
196
+
197
+ <a id="api-bareqrs"></a>
198
+
199
+ ```typescript
200
+ bareQRS: (q: number, r: number) => BareQRSPoint
201
+ ```
202
+
203
+ #### bareQRSScale
204
+
205
+ <a id="api-bareqrsscale"></a>
206
+
207
+ ```typescript
208
+ bareQRSScale: (point: BareQRSPoint, factor: number) => BareQRSPoint
209
+ ```
210
+
211
+ #### bareQRSSubtract
212
+
213
+ <a id="api-bareqrssubtract"></a>
214
+
215
+ ```typescript
216
+ bareQRSSubtract: (left: BareQRSPoint, right: BareQRSPoint) => BareQRSPoint
217
+ ```
218
+
219
+ #### coverRect
220
+
221
+ <a id="api-coverrect"></a>
222
+
223
+ ```typescript
224
+ coverRect: (width: number, height: number, layout: HexLayout) => QRWithXY[]
225
+ ```
226
+
227
+ Generate a hex grid which completely covers a rectangle of the given dimensions.
228
+
229
+
230
+ #### cubeAdd
231
+
232
+ <a id="api-cubeadd"></a>
233
+
234
+ ```typescript
235
+ cubeAdd: (left: HexCubePoint, right: HexCubePoint) => HexCubePoint
236
+ ```
237
+
238
+ Add two Cube points together.
239
+
240
+
241
+ #### cubeDistance
242
+
243
+ <a id="api-cubedistance"></a>
244
+
245
+ ```typescript
246
+ cubeDistance: (left: HexCubePoint, right: HexCubePoint) => number
247
+ ```
248
+
249
+ Calculate the Manhattan distance between two points.
250
+
251
+
252
+ #### cubeFromAxial
253
+
254
+ <a id="api-cubefromaxial"></a>
255
+
256
+ ```typescript
257
+ cubeFromAxial: (axial: AxialPoint) => HexCubePoint
258
+ ```
259
+
260
+ Transform an Axial point into a Cube point by calculating and materializing `s`.
261
+
262
+
263
+ #### cubeFromDoubleHeight
264
+
265
+ <a id="api-cubefromdoubleheight"></a>
266
+
267
+ ```typescript
268
+ cubeFromDoubleHeight: (double: DoubleHeightPoint) => HexCubePoint
269
+ ```
270
+
271
+ #### cubeFromDoubleWidth
272
+
273
+ <a id="api-cubefromdoublewidth"></a>
274
+
275
+ ```typescript
276
+ cubeFromDoubleWidth: (double: DoubleWidthPoint) => HexCubePoint
277
+ ```
278
+
279
+ #### cubeFromQR
280
+
281
+ <a id="api-cubefromqr"></a>
282
+
283
+ ```typescript
284
+ cubeFromQR: (q: number, r: number) => HexCubePoint
285
+ ```
286
+
287
+ Build a branded Cube point from `q` and `r` coordinates.
288
+
289
+
290
+ #### cubeHeading
291
+
292
+ <a id="api-cubeheading"></a>
293
+
294
+ ```typescript
295
+ cubeHeading: (from: HexCubePoint, toward: HexCubePoint) => HexCubeDirection | undefined
296
+ ```
297
+
298
+ #### cubeIntersection
299
+
300
+ <a id="api-cubeintersection"></a>
301
+
302
+ ```typescript
303
+ cubeIntersection: (center1: HexCubePoint, radius1: number, center2: HexCubePoint, radius2?: number) => HexCubePoint[]
304
+ ```
305
+
306
+ #### cubeLerp
307
+
308
+ <a id="api-cubelerp"></a>
309
+
310
+ ```typescript
311
+ cubeLerp: (a: HexCubePoint, b: HexCubePoint, frac: number) => HexCubePoint
312
+ ```
313
+
314
+ #### cubeLineDraw
315
+
316
+ <a id="api-cubelinedraw"></a>
317
+
318
+ ```typescript
319
+ cubeLineDraw: (a: HexCubePoint, b: HexCubePoint) => HexCubePoint[]
320
+ ```
321
+
322
+ #### cubeNeighbor
323
+
324
+ <a id="api-cubeneighbor"></a>
325
+
326
+ ```typescript
327
+ cubeNeighbor: (cube: HexCubePoint, direction: HexCubeDirection | CubeDiagDirection) => HexCubePoint
328
+ ```
329
+
330
+ Find the neighbor of the given hex in the given direction.
331
+
332
+
333
+ #### cubeRange
334
+
335
+ <a id="api-cuberange"></a>
336
+
337
+ ```typescript
338
+ cubeRange: (center: HexCubePoint, radius: number) => HexCubePoint[]
339
+ ```
340
+
341
+ #### cubeRotate
342
+
343
+ <a id="api-cuberotate"></a>
344
+
345
+ ```typescript
346
+ cubeRotate: (center: HexCubePoint, outer: HexCubePoint, rotation: HexRotation) => HexCubePoint
347
+ ```
348
+
349
+ #### cubeRound
350
+
351
+ <a id="api-cuberound"></a>
352
+
353
+ ```typescript
354
+ cubeRound: (cube: HexCubePoint) => HexCubePoint
355
+ ```
356
+
357
+ #### cubeSubtract
358
+
359
+ <a id="api-cubesubtract"></a>
360
+
361
+ ```typescript
362
+ cubeSubtract: (left: HexCubePoint, right: HexCubePoint) => HexCubePoint
363
+ ```
364
+
365
+ #### doubleHeightAdd
366
+
367
+ <a id="api-doubleheightadd"></a>
368
+
369
+ ```typescript
370
+ doubleHeightAdd: (left: DoubleHeightPoint, right: DoubleHeightPoint) => DoubleHeightPoint
371
+ ```
372
+
373
+ #### doubleHeightDistance
374
+
375
+ <a id="api-doubleheightdistance"></a>
376
+
377
+ ```typescript
378
+ doubleHeightDistance: (left: DoubleHeightPoint, right: DoubleHeightPoint) => number
379
+ ```
380
+
381
+ #### doubleHeightFromQRS
382
+
383
+ <a id="api-doubleheightfromqrs"></a>
384
+
385
+ ```typescript
386
+ doubleHeightFromQRS: (qrs: BareQRSPoint) => DoubleHeightPoint
387
+ ```
388
+
389
+ #### doubleHeightNeighbor
390
+
391
+ <a id="api-doubleheightneighbor"></a>
392
+
393
+ ```typescript
394
+ doubleHeightNeighbor: (double: DoubleHeightPoint, direction: DoubleHeightDirection) => DoubleHeightPoint
395
+ ```
396
+
397
+ #### doubleWidthAdd
398
+
399
+ <a id="api-doublewidthadd"></a>
400
+
401
+ ```typescript
402
+ doubleWidthAdd: (left: DoubleWidthPoint, right: DoubleWidthPoint) => DoubleWidthPoint
403
+ ```
404
+
405
+ #### doubleWidthDistance
406
+
407
+ <a id="api-doublewidthdistance"></a>
408
+
409
+ ```typescript
410
+ doubleWidthDistance: (left: DoubleWidthPoint, right: DoubleWidthPoint) => number
411
+ ```
412
+
413
+ #### doubleWidthFromQRS
414
+
415
+ <a id="api-doublewidthfromqrs"></a>
416
+
417
+ ```typescript
418
+ doubleWidthFromQRS: (qrs: BareQRSPoint) => DoubleWidthPoint
419
+ ```
420
+
421
+ #### doubleWidthNeighbor
422
+
423
+ <a id="api-doublewidthneighbor"></a>
424
+
425
+ ```typescript
426
+ doubleWidthNeighbor: (double: DoubleWidthPoint, direction: DoubleWidthDirection) => DoubleWidthPoint
427
+ ```
428
+
429
+ #### evenQFromQRS
430
+
431
+ <a id="api-evenqfromqrs"></a>
432
+
433
+ ```typescript
434
+ evenQFromQRS: (point: BareQRSPoint) => EvenQPoint
435
+ ```
436
+
437
+ #### evenRFromQRS
438
+
439
+ <a id="api-evenrfromqrs"></a>
440
+
441
+ ```typescript
442
+ evenRFromQRS: (point: BareQRSPoint) => EvenRPoint
443
+ ```
444
+
445
+ #### flatQRSFromPixel
446
+
447
+ <a id="api-flatqrsfrompixel"></a>
448
+
449
+ ```typescript
450
+ flatQRSFromPixel: <P extends QRSPoint<S>, S extends QRSSystem>({ x, y }: {
451
+ x: number;
452
+ y: number;
453
+ }, builder: QRSBuilder<P>, scale?: number) => P
454
+ ```
455
+
456
+ #### hexContainsChecker
457
+
458
+ <a id="api-hexcontainschecker"></a>
459
+
460
+ ```typescript
461
+ hexContainsChecker: (corners: PointXY[]) => (xy: PointXY) => boolean
462
+ ```
463
+
464
+ Build a function which can check to see if the given pixel coordinates would be contained by the hex described by the corners. To be useful, cache this function, and then call it with pixel coordinates translated to the original hex's center.
465
+
466
+
467
+ #### hexCorners
468
+
469
+ <a id="api-hexcorners"></a>
470
+
471
+ ```typescript
472
+ hexCorners: (qrs: BareQRSPoint, layout: HexLayout) => PointXY[]
473
+ ```
474
+
475
+ #### hexCornersContainPoint
476
+
477
+ <a id="api-hexcornerscontainpoint"></a>
478
+
479
+ ```typescript
480
+ hexCornersContainPoint: (corners: PointXY[], xy: PointXY) => boolean
481
+ ```
482
+
483
+ #### hexDistance
484
+
485
+ <a id="api-hexdistance"></a>
486
+
487
+ ```typescript
488
+ hexDistance: (left: BareQRSPoint, right: BareQRSPoint) => number
489
+ ```
490
+
491
+ Calculate the Manhattan distance between two hex points.
492
+
493
+
494
+ #### hexesWithin
495
+
496
+ <a id="api-hexeswithin"></a>
497
+
498
+ ```typescript
499
+ hexesWithin: (radius: number) => number
500
+ ```
501
+
502
+ How many hexes are reachable from a starting hex given a Manhattan distance radius?
503
+
504
+
505
+ #### hexEuclidDistance
506
+
507
+ <a id="api-hexeucliddistance"></a>
508
+
509
+ ```typescript
510
+ hexEuclidDistance: (left: BareQRSPoint, right: BareQRSPoint) => number
511
+ ```
512
+
513
+ Euclidean distance between two hex points.
514
+
515
+
516
+
517
+ #### hexReachable
518
+
519
+ <a id="api-hexreachable"></a>
520
+
521
+ ```typescript
522
+ hexReachable: <P extends Point, Id extends string | number>(start: P, steps: number, directions: Readonly<Readonly<P>[]>, adder: (left: P, right: P) => P, identity: (point: P) => Id, isBlocked: (point: P, id: Id) => boolean, onPoint?: ((point: P, distance: number, prior: P, direction: Readonly<P>) => void) | undefined) => HexReachable<P>[]
523
+ ```
524
+
525
+ #### lerp
526
+
527
+ <a id="api-lerp"></a>
528
+
529
+ ```typescript
530
+ lerp: (a: number, b: number, frac: number) => number
531
+ ```
532
+
533
+ Linear interpolate from `a` to `b` with `frac` fractional progress (percent complete, in the range `[0,1]`).
534
+
535
+
536
+ #### oddQFromQRS
537
+
538
+ <a id="api-oddqfromqrs"></a>
539
+
540
+ ```typescript
541
+ oddQFromQRS: (point: BareQRSPoint) => OddQPoint
542
+ ```
543
+
544
+ #### oddRFromQRS
545
+
546
+ <a id="api-oddrfromqrs"></a>
547
+
548
+ ```typescript
549
+ oddRFromQRS: (point: BareQRSPoint) => OddRPoint
550
+ ```
551
+
552
+ #### offsetDistance
553
+
554
+ <a id="api-offsetdistance"></a>
555
+
556
+ ```typescript
557
+ offsetDistance: (left: OffsetPoint<OffsetSystem>, right: OffsetPoint<OffsetSystem>) => number
558
+ ```
559
+
560
+ #### offsetNeighbor
561
+
562
+ <a id="api-offsetneighbor"></a>
563
+
564
+ ```typescript
565
+ offsetNeighbor: <S extends OffsetSystem>(offset: OffsetPoint<S>, direction: OffsetDirection) => OffsetPoint<S>
566
+ ```
567
+
568
+ #### pixelFromFlatQRS
569
+
570
+ <a id="api-pixelfromflatqrs"></a>
571
+
572
+ ```typescript
573
+ pixelFromFlatQRS: ({ q, r }: BareQRSPoint, scale?: number) => PointXY
574
+ ```
575
+
576
+ #### pixelFromPointyQRS
577
+
578
+ <a id="api-pixelfrompointyqrs"></a>
579
+
580
+ ```typescript
581
+ pixelFromPointyQRS: ({ q, r }: BareQRSPoint, scale?: number) => PointXY
582
+ ```
583
+
584
+ #### pixelFromQRS
585
+
586
+ <a id="api-pixelfromqrs"></a>
587
+
588
+ ```typescript
589
+ pixelFromQRS: ({ q, r }: BareQRSPoint, { orientation: { f0, f1, f2, f3 }, origin: { x: cx, y: cy }, size: { x: scaleX, y: scaleY } }: HexLayout) => PointXY
590
+ ```
591
+
592
+ #### pixelOffsetOfCorner
593
+
594
+ <a id="api-pixeloffsetofcorner"></a>
595
+
596
+ ```typescript
597
+ pixelOffsetOfCorner: (t: HexCorner, u: HexLayout) => Readonly<PointXY>
598
+ ```
599
+
600
+ #### pointyQRSFromPixel
601
+
602
+ <a id="api-pointyqrsfrompixel"></a>
603
+
604
+ ```typescript
605
+ pointyQRSFromPixel: <P extends QRSPoint<S>, S extends QRSSystem>({ x, y }: {
606
+ x: number;
607
+ y: number;
608
+ }, builder: QRSBuilder<P>, scale?: number) => P
609
+ ```
610
+
611
+ #### qrsEQ
612
+
613
+ <a id="api-qrseq"></a>
614
+
615
+ ```typescript
616
+ qrsEQ: (a: Readonly<BareHexCubePoint>, b: Readonly<BareHexCubePoint>) => boolean
617
+ ```
618
+
619
+ #### qrsFromDoubleHeight
620
+
621
+ <a id="api-qrsfromdoubleheight"></a>
622
+
623
+ ```typescript
624
+ qrsFromDoubleHeight: <S extends QRSSystem, P extends QRSPoint<S>>(double: DoubleHeightPoint, builder: QRSBuilder<P>) => P
625
+ ```
626
+
627
+ #### qrsFromDoubleWidth
628
+
629
+ <a id="api-qrsfromdoublewidth"></a>
630
+
631
+ ```typescript
632
+ qrsFromDoubleWidth: <S extends QRSSystem, P extends QRSPoint<S>>(double: DoubleWidthPoint, builder: QRSBuilder<P>) => P
633
+ ```
634
+
635
+ #### qrsFromPixel
636
+
637
+ <a id="api-qrsfrompixel"></a>
638
+
639
+ ```typescript
640
+ qrsFromPixel: <P extends QRSPoint<S>, S extends QRSSystem>({ x, y }: PointXY, { orientation: { b0, b1, b2, b3 }, origin: { x: cx, y: cy }, size: { x: scaleX, y: scaleY } }: HexLayout, builder: QRSBuilder<P>) => P
641
+ ```
642
+
643
+ #### qrsHashCode
644
+
645
+ <a id="api-qrshashcode"></a>
646
+
647
+ ```typescript
648
+ qrsHashCode: ({ q, r }: BareQRSPoint) => bigint
649
+ ```
650
+
651
+ Generate a (very simplistic) hash code for a hex point which could be used as a Map/Hash key.
652
+
653
+
654
+ #### qrsIntersection
655
+
656
+ <a id="api-qrsintersection"></a>
657
+
658
+ ```typescript
659
+ qrsIntersection: <P extends QRSPoint<QRSSystem>>(buildFn: QRSBuilder<P>, center1: P, radius1: number, center2: P, radius2?: number) => P[]
660
+ ```
661
+
662
+ #### qrsRange
663
+
664
+ <a id="api-qrsrange"></a>
665
+
666
+ ```typescript
667
+ qrsRange: <P extends QRSPoint<QRSSystem>>(addFn: QRSAdder<P>, buildFn: QRSBuilder<P>, center: P, radius: number) => P[]
668
+ ```
669
+
670
+ Calculate all the points within a given radius of a given center.
671
+
672
+
673
+ #### qrsRing
674
+
675
+ <a id="api-qrsring"></a>
676
+
677
+ ```typescript
678
+ qrsRing: <P extends QRSPoint<S>, S extends QRSSystem>(center: P, radius: number, builder: QRSBuilder<P>) => P[]
679
+ ```
680
+
681
+ #### qrsScale
682
+
683
+ <a id="api-qrsscale"></a>
684
+
685
+ ```typescript
686
+ qrsScale: <P extends QRSPoint<S>, S extends QRSSystem>(point: P, factor: number, builder: QRSBuilder<P>) => P
687
+ ```
688
+
689
+ #### qrsSpiral
690
+
691
+ <a id="api-qrsspiral"></a>
692
+
693
+ ```typescript
694
+ qrsSpiral: <P extends QRSPoint<S>, S extends QRSSystem>(center: P, radius: number, builder: QRSBuilder<P>) => P[]
695
+ ```
696
+
697
+ #### qrsSubtract
698
+
699
+ <a id="api-qrssubtract"></a>
700
+
701
+ ```typescript
702
+ qrsSubtract: <P extends QRSPoint<S>, S extends QRSSystem>(left: P, right: P, builder: QRSBuilder<P>) => P
703
+ ```
704
+
705
+ #### stringifyAxial
706
+
707
+ <a id="api-stringifyaxial"></a>
708
+
709
+ ```typescript
710
+ stringifyAxial: ({ q, r }: AxialPoint | BareQRSPoint) => string
711
+ ```
712
+
713
+ #### stringifyCube
714
+
715
+ <a id="api-stringifycube"></a>
716
+
717
+ ```typescript
718
+ stringifyCube: ({ q, r, s }: BareHexCubePoint) => string
719
+ ```
720
+
721
+ #### stringifyOffset
722
+
723
+ <a id="api-stringifyoffset"></a>
724
+
725
+ ```typescript
726
+ stringifyOffset: ({ row, col, system }: OffsetPoint<OffsetSystem>) => string
727
+ ```
728
+
729
+ #### svgForHexGrid
730
+
731
+ <a id="api-svgforhexgrid"></a>
732
+
733
+ ```typescript
734
+ svgForHexGrid: (grid: {
735
+ height: number;
736
+ hexes: QRWithXY[];
737
+ width: number;
738
+ }, layout: HexLayout) => string
739
+ ```
740
+
741
+ Build a rudimentary SVG for the described grid. Intended more for testing and visual inspection than for anything significant.
742
+
743
+
744
+ #### triangleContainsChecker
745
+
746
+ <a id="api-trianglecontainschecker"></a>
747
+
748
+ ```typescript
749
+ triangleContainsChecker: (triangle: [PointXY, PointXY, PointXY]) => (xy: PointXY) => boolean
750
+ ```
751
+
752
+ Generate a function which can check to see if a given point is inside the triangle described by the three points.
753
+
754
+
755
+ #### triangleContainsPoint
756
+
757
+ <a id="api-trianglecontainspoint"></a>
758
+
759
+ ```typescript
760
+ triangleContainsPoint: (triangle: [PointXY, PointXY, PointXY], point: PointXY) => boolean
761
+ ```
762
+
763
+ ### Interfaces
764
+
765
+ #### BareDouble
766
+
767
+ <a id="api-baredouble"></a>
768
+
769
+ ```typescript
770
+ export interface BareDouble
771
+ ```
772
+
773
+ #### BareHexCubePoint
774
+
775
+ <a id="api-barehexcubepoint"></a>
776
+
777
+ ```typescript
778
+ export interface BareHexCubePoint extends BareQRSPoint
779
+ ```
780
+
781
+ Cube points store the `s` value explicitly, instead of calculating it.
782
+
783
+
784
+ #### BareOffset
785
+
786
+ <a id="api-bareoffset"></a>
787
+
788
+ ```typescript
789
+ export interface BareOffset
790
+ ```
791
+
792
+ #### BareQRSPoint
793
+
794
+ <a id="api-bareqrspoint"></a>
795
+
796
+ ```typescript
797
+ export interface BareQRSPoint
798
+ ```
799
+
800
+ In the QRS notation, `q` is the column, while `r` is the row.
801
+
802
+
803
+ #### DoubleHeightPoint
804
+
805
+ <a id="api-doubleheightpoint"></a>
806
+
807
+ ```typescript
808
+ export interface DoubleHeightPoint extends DoublePoint<DoubleHeight>
809
+ ```
810
+
811
+ #### DoublePoint
812
+
813
+ <a id="api-doublepoint"></a>
814
+
815
+ ```typescript
816
+ export interface DoublePoint<SystemT extends DoubleSystem> extends Point, BareDouble
817
+ ```
818
+
819
+ #### DoubleWidthPoint
820
+
821
+ <a id="api-doublewidthpoint"></a>
822
+
823
+ ```typescript
824
+ export interface DoubleWidthPoint extends DoublePoint<DoubleWidth>
825
+ ```
826
+
827
+ #### EvenQPoint
828
+
829
+ <a id="api-evenqpoint"></a>
830
+
831
+ ```typescript
832
+ export interface EvenQPoint extends OffsetPoint<typeof EVEN_Q>
833
+ ```
834
+
835
+ #### EvenRPoint
836
+
837
+ <a id="api-evenrpoint"></a>
838
+
839
+ ```typescript
840
+ export interface EvenRPoint extends OffsetPoint<typeof EVEN_R>
841
+ ```
842
+
843
+ #### HexCubePoint
844
+
845
+ <a id="api-hexcubepoint"></a>
846
+
847
+ ```typescript
848
+ export interface HexCubePoint extends QRSPoint<Cube>, BareHexCubePoint
849
+ ```
850
+
851
+ #### HexLayout
852
+
853
+ <a id="api-hexlayout"></a>
854
+
855
+ ```typescript
856
+ export interface HexLayout
857
+ ```
858
+
859
+ #### HexOrientation
860
+
861
+ <a id="api-hexorientation"></a>
862
+
863
+ ```typescript
864
+ export interface HexOrientation
865
+ ```
866
+
867
+ #### HexOrientations
868
+
869
+ <a id="api-hexorientations"></a>
870
+
871
+ ```typescript
872
+ export interface HexOrientations
873
+ ```
874
+
875
+ #### HexSystems
876
+
877
+ <a id="api-hexsystems"></a>
878
+
879
+ ```typescript
880
+ export interface HexSystems
881
+ ```
882
+
883
+ #### OddQPoint
884
+
885
+ <a id="api-oddqpoint"></a>
886
+
887
+ ```typescript
888
+ export interface OddQPoint extends OffsetPoint<typeof ODD_Q>
889
+ ```
890
+
891
+ #### OddRPoint
892
+
893
+ <a id="api-oddrpoint"></a>
894
+
895
+ ```typescript
896
+ export interface OddRPoint extends OffsetPoint<typeof ODD_R>
897
+ ```
898
+
899
+ #### OffsetPoint
900
+
901
+ <a id="api-offsetpoint"></a>
902
+
903
+ ```typescript
904
+ export interface OffsetPoint<SystemT extends OffsetSystem> extends Point, BareOffset
905
+ ```
906
+
907
+ #### Point
908
+
909
+ <a id="api-point"></a>
910
+
911
+ ```typescript
912
+ export interface Point
913
+ ```
914
+
915
+ #### PointXY
916
+
917
+ <a id="api-pointxy"></a>
918
+
919
+ ```typescript
920
+ export interface PointXY
921
+ ```
922
+
923
+ #### QRSPoint
924
+
925
+ <a id="api-qrspoint"></a>
926
+
927
+ ```typescript
928
+ export interface QRSPoint<S extends QRSSystem> extends Point, BareQRSPoint
929
+ ```
930
+
931
+ A QRS Point which also has its [HexSystem](#api-hexsystem) materialized with its coordinates.
932
+
933
+
934
+ #### QRWithXY
935
+
936
+ <a id="api-qrwithxy"></a>
937
+
938
+ ```typescript
939
+ export interface QRWithXY extends PointXY, BareQRSPoint
940
+ ```
941
+
942
+ ### TypeAliases
943
+
944
+ #### Axial
945
+
946
+ <a id="api-axial"></a>
947
+
948
+ ```typescript
949
+ type Axial = typeof AXIAL;
950
+ ```
951
+
952
+ #### AxialDirection
953
+
954
+ <a id="api-axialdirection"></a>
955
+
956
+ ```typescript
957
+ type AxialDirection = typeof AXIAL_POINTY_E | typeof AXIAL_POINTY_NE | typeof AXIAL_POINTY_NW | typeof AXIAL_POINTY_W | typeof AXIAL_POINTY_SW | typeof AXIAL_POINTY_SE;
958
+ ```
959
+
960
+ #### AxialPoint
961
+
962
+ <a id="api-axialpoint"></a>
963
+
964
+ ```typescript
965
+ type AxialPoint = QRSPoint<Axial>;
966
+ ```
967
+
968
+ Axial coordinates don't store the `s` coordinate, as it can always be calculated via `q + r + s = 0`.
969
+
970
+
971
+ #### AxialTuple
972
+
973
+ <a id="api-axialtuple"></a>
974
+
975
+ ```typescript
976
+ type AxialTuple = [q: number, r: number];
977
+ ```
978
+
979
+ #### Axis
980
+
981
+ <a id="api-axis"></a>
982
+
983
+ ```typescript
984
+ type Axis<P extends Point> = Exclude<keyof P, keyof Point>;
985
+ ```
986
+
987
+ #### Cube
988
+
989
+ <a id="api-cube"></a>
990
+
991
+ ```typescript
992
+ type Cube = typeof CUBE;
993
+ ```
994
+
995
+ #### CubeDiagDirection
996
+
997
+ <a id="api-cubediagdirection"></a>
998
+
999
+ ```typescript
1000
+ type CubeDiagDirection = typeof CUBE_DIAG_SE | typeof CUBE_DIAG_NW | typeof CUBE_DIAG_POINTY_N | typeof CUBE_DIAG_POINTY_NE | typeof CUBE_DIAG_POINTY_S | typeof CUBE_DIAG_POINTY_SW;
1001
+ ```
1002
+
1003
+ #### CubeTuple
1004
+
1005
+ <a id="api-cubetuple"></a>
1006
+
1007
+ ```typescript
1008
+ type CubeTuple = [q: number, r: number, s: number];
1009
+ ```
1010
+
1011
+ #### DoubleHeight
1012
+
1013
+ <a id="api-doubleheight"></a>
1014
+
1015
+ ```typescript
1016
+ type DoubleHeight = typeof DOUBLE_H;
1017
+ ```
1018
+
1019
+ #### DoubleHeightDirection
1020
+
1021
+ <a id="api-doubleheightdirection"></a>
1022
+
1023
+ ```typescript
1024
+ type DoubleHeightDirection = typeof DOUBLE_H_N | typeof DOUBLE_H_NE | typeof DOUBLE_H_SE | typeof DOUBLE_H_S | typeof DOUBLE_H_SW | typeof DOUBLE_H_NW;
1025
+ ```
1026
+
1027
+ #### DoubleSystem
1028
+
1029
+ <a id="api-doublesystem"></a>
1030
+
1031
+ ```typescript
1032
+ type DoubleSystem = DoubleWidth | DoubleHeight;
1033
+ ```
1034
+
1035
+ #### DoubleWidth
1036
+
1037
+ <a id="api-doublewidth"></a>
1038
+
1039
+ ```typescript
1040
+ type DoubleWidth = typeof DOUBLE_W;
1041
+ ```
1042
+
1043
+ #### DoubleWidthDirection
1044
+
1045
+ <a id="api-doublewidthdirection"></a>
1046
+
1047
+ ```typescript
1048
+ type DoubleWidthDirection = typeof DOUBLE_W_E | typeof DOUBLE_W_SE | typeof DOUBLE_W_SW | typeof DOUBLE_W_W | typeof DOUBLE_W_NW | typeof DOUBLE_W_NE;
1049
+ ```
1050
+
1051
+ #### EvenQ
1052
+
1053
+ <a id="api-evenq"></a>
1054
+
1055
+ ```typescript
1056
+ type EvenQ = typeof EVEN_Q;
1057
+ ```
1058
+
1059
+ #### EvenR
1060
+
1061
+ <a id="api-evenr"></a>
1062
+
1063
+ ```typescript
1064
+ type EvenR = typeof EVEN_R;
1065
+ ```
1066
+
1067
+ #### HexCorner
1068
+
1069
+ <a id="api-hexcorner"></a>
1070
+
1071
+ ```typescript
1072
+ type HexCorner = 0 | 1 | 2 | 3 | 4 | 5;
1073
+ ```
1074
+
1075
+ #### HexCubeDirection
1076
+
1077
+ <a id="api-hexcubedirection"></a>
1078
+
1079
+ ```typescript
1080
+ type HexCubeDirection = typeof CUBE_POINTY_E | typeof CUBE_NE | typeof CUBE_POINTY_NW | typeof CUBE_POINTY_W | typeof CUBE_SW | typeof CUBE_POINTY_SE;
1081
+ ```
1082
+
1083
+ #### HexOrientationName
1084
+
1085
+ <a id="api-hexorientationname"></a>
1086
+
1087
+ ```typescript
1088
+ type HexOrientationName = keyof HexOrientations;
1089
+ ```
1090
+
1091
+ #### HexReachable
1092
+
1093
+ <a id="api-hexreachable"></a>
1094
+
1095
+ ```typescript
1096
+ type HexReachable<P extends Point> = {
1097
+ direction?: undefined;
1098
+ distance: 0;
1099
+ point: P;
1100
+ prior?: undefined;
1101
+ } | {
1102
+ direction: Readonly<P>;
1103
+ distance: Exclude<number, 0>;
1104
+ point: P;
1105
+ prior: P;
1106
+ };
1107
+ ```
1108
+
1109
+ #### HexRotation
1110
+
1111
+ <a id="api-hexrotation"></a>
1112
+
1113
+ ```typescript
1114
+ type HexRotation = 0 | typeof CW_60 | typeof CW_120 | typeof CW_180 | typeof CW_240 | typeof CW_300;
1115
+ ```
1116
+
1117
+ #### HexSystem
1118
+
1119
+ <a id="api-hexsystem"></a>
1120
+
1121
+ ```typescript
1122
+ type HexSystem = keyof HexSystems;
1123
+ ```
1124
+
1125
+ #### OddQ
1126
+
1127
+ <a id="api-oddq"></a>
1128
+
1129
+ ```typescript
1130
+ type OddQ = typeof ODD_Q;
1131
+ ```
1132
+
1133
+ #### OddR
1134
+
1135
+ <a id="api-oddr"></a>
1136
+
1137
+ ```typescript
1138
+ type OddR = typeof ODD_R;
1139
+ ```
1140
+
1141
+ #### OffsetDirection
1142
+
1143
+ <a id="api-offsetdirection"></a>
1144
+
1145
+ ```typescript
1146
+ type OffsetDirection = typeof OFFSET_R_E | typeof OFFSET_R_NE | typeof OFFSET_R_NW | typeof OFFSET_R_W | typeof OFFSET_R_SW | typeof OFFSET_R_SE;
1147
+ ```
1148
+
1149
+ #### OffsetSystem
1150
+
1151
+ <a id="api-offsetsystem"></a>
1152
+
1153
+ ```typescript
1154
+ type OffsetSystem = typeof ODD_Q | typeof ODD_R | typeof EVEN_Q | typeof EVEN_R;
1155
+ ```
1156
+
1157
+ #### QRSAdder
1158
+
1159
+ <a id="api-qrsadder"></a>
1160
+
1161
+ ```typescript
1162
+ type QRSAdder<P extends QRSPoint<QRSSystem>> = (left: P, right: P) => P;
1163
+ ```
1164
+
1165
+ A function which can add together two QRS points with the same system.
1166
+
1167
+
1168
+ #### QRSBuilder
1169
+
1170
+ <a id="api-qrsbuilder"></a>
1171
+
1172
+ ```typescript
1173
+ type QRSBuilder<P extends QRSPoint<QRSSystem>> = (q: number, r: number) => P;
1174
+ ```
1175
+
1176
+ A function which can structures numbers into a QRS point for a given system.
1177
+
1178
+
1179
+ #### QRSSystem
1180
+
1181
+ <a id="api-qrssystem"></a>
1182
+
1183
+ ```typescript
1184
+ type QRSSystem = Axial | Cube;
1185
+ ```
1186
+
1187
+ ### Variables
1188
+
1189
+ #### AXIAL
1190
+
1191
+ <a id="api-axial"></a>
1192
+
1193
+ ```typescript
1194
+ AXIAL: "axial"
1195
+ ```
1196
+
1197
+ #### AXIAL_DIRECTIONS
1198
+
1199
+ <a id="api-axial-directions"></a>
1200
+
1201
+ ```typescript
1202
+ AXIAL_DIRECTIONS: Readonly<AxialDirection[]>
1203
+ ```
1204
+
1205
+ #### AXIAL_EPSILON
1206
+
1207
+ <a id="api-axial-epsilon"></a>
1208
+
1209
+ ```typescript
1210
+ AXIAL_EPSILON: Readonly<{
1211
+ readonly q: 0.000001;
1212
+ readonly r: 0.000001;
1213
+ readonly system: "axial";
1214
+ }>
1215
+ ```
1216
+
1217
+ #### AXIAL_FLAT_N
1218
+
1219
+ <a id="api-axial-flat-n"></a>
1220
+
1221
+ ```typescript
1222
+ AXIAL_FLAT_N: Readonly<{
1223
+ readonly q: 0;
1224
+ readonly r: -1;
1225
+ readonly system: "axial";
1226
+ }>
1227
+ ```
1228
+
1229
+ #### AXIAL_FLAT_NE
1230
+
1231
+ <a id="api-axial-flat-ne"></a>
1232
+
1233
+ ```typescript
1234
+ AXIAL_FLAT_NE: Readonly<{
1235
+ readonly q: 1;
1236
+ readonly r: -1;
1237
+ readonly system: "axial";
1238
+ }>
1239
+ ```
1240
+
1241
+ #### AXIAL_FLAT_NW
1242
+
1243
+ <a id="api-axial-flat-nw"></a>
1244
+
1245
+ ```typescript
1246
+ AXIAL_FLAT_NW: Readonly<{
1247
+ readonly q: -1;
1248
+ readonly r: 0;
1249
+ readonly system: "axial";
1250
+ }>
1251
+ ```
1252
+
1253
+ #### AXIAL_FLAT_S
1254
+
1255
+ <a id="api-axial-flat-s"></a>
1256
+
1257
+ ```typescript
1258
+ AXIAL_FLAT_S: Readonly<{
1259
+ readonly q: 0;
1260
+ readonly r: 1;
1261
+ readonly system: "axial";
1262
+ }>
1263
+ ```
1264
+
1265
+ #### AXIAL_FLAT_SE
1266
+
1267
+ <a id="api-axial-flat-se"></a>
1268
+
1269
+ ```typescript
1270
+ AXIAL_FLAT_SE: Readonly<{
1271
+ readonly q: 1;
1272
+ readonly r: 0;
1273
+ readonly system: "axial";
1274
+ }>
1275
+ ```
1276
+
1277
+ #### AXIAL_FLAT_SW
1278
+
1279
+ <a id="api-axial-flat-sw"></a>
1280
+
1281
+ ```typescript
1282
+ AXIAL_FLAT_SW: Readonly<{
1283
+ readonly q: -1;
1284
+ readonly r: 1;
1285
+ readonly system: "axial";
1286
+ }>
1287
+ ```
1288
+
1289
+ #### AXIAL_ORIGIN
1290
+
1291
+ <a id="api-axial-origin"></a>
1292
+
1293
+ ```typescript
1294
+ AXIAL_ORIGIN: Readonly<{
1295
+ readonly q: 0;
1296
+ readonly r: 0;
1297
+ readonly system: "axial";
1298
+ }>
1299
+ ```
1300
+
1301
+ #### AXIAL_POINTY_E
1302
+
1303
+ <a id="api-axial-pointy-e"></a>
1304
+
1305
+ ```typescript
1306
+ AXIAL_POINTY_E: Readonly<{
1307
+ readonly q: 1;
1308
+ readonly r: 0;
1309
+ readonly system: "axial";
1310
+ }>
1311
+ ```
1312
+
1313
+ #### AXIAL_POINTY_NE
1314
+
1315
+ <a id="api-axial-pointy-ne"></a>
1316
+
1317
+ ```typescript
1318
+ AXIAL_POINTY_NE: Readonly<{
1319
+ readonly q: 1;
1320
+ readonly r: -1;
1321
+ readonly system: "axial";
1322
+ }>
1323
+ ```
1324
+
1325
+ #### AXIAL_POINTY_NW
1326
+
1327
+ <a id="api-axial-pointy-nw"></a>
1328
+
1329
+ ```typescript
1330
+ AXIAL_POINTY_NW: Readonly<{
1331
+ readonly q: 0;
1332
+ readonly r: -1;
1333
+ readonly system: "axial";
1334
+ }>
1335
+ ```
1336
+
1337
+ #### AXIAL_POINTY_SE
1338
+
1339
+ <a id="api-axial-pointy-se"></a>
1340
+
1341
+ ```typescript
1342
+ AXIAL_POINTY_SE: Readonly<{
1343
+ readonly q: 0;
1344
+ readonly r: 1;
1345
+ readonly system: "axial";
1346
+ }>
1347
+ ```
1348
+
1349
+ #### AXIAL_POINTY_SW
1350
+
1351
+ <a id="api-axial-pointy-sw"></a>
1352
+
1353
+ ```typescript
1354
+ AXIAL_POINTY_SW: Readonly<{
1355
+ readonly q: -1;
1356
+ readonly r: 1;
1357
+ readonly system: "axial";
1358
+ }>
1359
+ ```
1360
+
1361
+ #### AXIAL_POINTY_W
1362
+
1363
+ <a id="api-axial-pointy-w"></a>
1364
+
1365
+ ```typescript
1366
+ AXIAL_POINTY_W: Readonly<{
1367
+ readonly q: -1;
1368
+ readonly r: 0;
1369
+ readonly system: "axial";
1370
+ }>
1371
+ ```
1372
+
1373
+ #### CCW_120
1374
+
1375
+ <a id="api-ccw-120"></a>
1376
+
1377
+ ```typescript
1378
+ CCW_120 = 240
1379
+ ```
1380
+
1381
+ #### CCW_180
1382
+
1383
+ <a id="api-ccw-180"></a>
1384
+
1385
+ ```typescript
1386
+ CCW_180 = 180
1387
+ ```
1388
+
1389
+ #### CCW_240
1390
+
1391
+ <a id="api-ccw-240"></a>
1392
+
1393
+ ```typescript
1394
+ CCW_240 = 120
1395
+ ```
1396
+
1397
+ #### CCW_300
1398
+
1399
+ <a id="api-ccw-300"></a>
1400
+
1401
+ ```typescript
1402
+ CCW_300 = 60
1403
+ ```
1404
+
1405
+ #### CCW_60
1406
+
1407
+ <a id="api-ccw-60"></a>
1408
+
1409
+ ```typescript
1410
+ CCW_60 = 300
1411
+ ```
1412
+
1413
+ #### CUBE
1414
+
1415
+ <a id="api-cube"></a>
1416
+
1417
+ ```typescript
1418
+ CUBE: "cube"
1419
+ ```
1420
+
1421
+ #### CUBE_DIAG_FLAT_E
1422
+
1423
+ <a id="api-cube-diag-flat-e"></a>
1424
+
1425
+ ```typescript
1426
+ CUBE_DIAG_FLAT_E: Readonly<{
1427
+ readonly q: 2;
1428
+ readonly r: -1;
1429
+ readonly s: 1;
1430
+ readonly system: "cube";
1431
+ }>
1432
+ ```
1433
+
1434
+ #### CUBE_DIAG_FLAT_NE
1435
+
1436
+ <a id="api-cube-diag-flat-ne"></a>
1437
+
1438
+ ```typescript
1439
+ CUBE_DIAG_FLAT_NE: Readonly<{
1440
+ readonly q: 1;
1441
+ readonly r: -2;
1442
+ readonly s: 1;
1443
+ readonly system: "cube";
1444
+ }>
1445
+ ```
1446
+
1447
+ #### CUBE_DIAG_FLAT_SW
1448
+
1449
+ <a id="api-cube-diag-flat-sw"></a>
1450
+
1451
+ ```typescript
1452
+ CUBE_DIAG_FLAT_SW: Readonly<{
1453
+ readonly q: -1;
1454
+ readonly r: 2;
1455
+ readonly s: -1;
1456
+ readonly system: "cube";
1457
+ }>
1458
+ ```
1459
+
1460
+ #### CUBE_DIAG_FLAT_W
1461
+
1462
+ <a id="api-cube-diag-flat-w"></a>
1463
+
1464
+ ```typescript
1465
+ CUBE_DIAG_FLAT_W: Readonly<{
1466
+ readonly q: -2;
1467
+ readonly r: 1;
1468
+ readonly s: 1;
1469
+ readonly system: "cube";
1470
+ }>
1471
+ ```
1472
+
1473
+ #### CUBE_DIAG_NW
1474
+
1475
+ <a id="api-cube-diag-nw"></a>
1476
+
1477
+ ```typescript
1478
+ CUBE_DIAG_NW: Readonly<{
1479
+ readonly q: -1;
1480
+ readonly r: -1;
1481
+ readonly s: 2;
1482
+ readonly system: "cube";
1483
+ }>
1484
+ ```
1485
+
1486
+ #### CUBE_DIAG_POINTY_N
1487
+
1488
+ <a id="api-cube-diag-pointy-n"></a>
1489
+
1490
+ ```typescript
1491
+ CUBE_DIAG_POINTY_N: Readonly<{
1492
+ readonly q: 1;
1493
+ readonly r: -2;
1494
+ readonly s: 1;
1495
+ readonly system: "cube";
1496
+ }>
1497
+ ```
1498
+
1499
+ #### CUBE_DIAG_POINTY_NE
1500
+
1501
+ <a id="api-cube-diag-pointy-ne"></a>
1502
+
1503
+ ```typescript
1504
+ CUBE_DIAG_POINTY_NE: Readonly<{
1505
+ readonly q: 2;
1506
+ readonly r: -1;
1507
+ readonly s: 1;
1508
+ readonly system: "cube";
1509
+ }>
1510
+ ```
1511
+
1512
+ #### CUBE_DIAG_POINTY_S
1513
+
1514
+ <a id="api-cube-diag-pointy-s"></a>
1515
+
1516
+ ```typescript
1517
+ CUBE_DIAG_POINTY_S: Readonly<{
1518
+ readonly q: -1;
1519
+ readonly r: 2;
1520
+ readonly s: -1;
1521
+ readonly system: "cube";
1522
+ }>
1523
+ ```
1524
+
1525
+ #### CUBE_DIAG_POINTY_SW
1526
+
1527
+ <a id="api-cube-diag-pointy-sw"></a>
1528
+
1529
+ ```typescript
1530
+ CUBE_DIAG_POINTY_SW: Readonly<{
1531
+ readonly q: -2;
1532
+ readonly r: 1;
1533
+ readonly s: 1;
1534
+ readonly system: "cube";
1535
+ }>
1536
+ ```
1537
+
1538
+ #### CUBE_DIAG_SE
1539
+
1540
+ <a id="api-cube-diag-se"></a>
1541
+
1542
+ ```typescript
1543
+ CUBE_DIAG_SE: Readonly<{
1544
+ readonly q: 1;
1545
+ readonly r: 1;
1546
+ readonly s: -2;
1547
+ readonly system: "cube";
1548
+ }>
1549
+ ```
1550
+
1551
+ #### CUBE_EPSILON
1552
+
1553
+ <a id="api-cube-epsilon"></a>
1554
+
1555
+ ```typescript
1556
+ CUBE_EPSILON: Readonly<{
1557
+ q: number;
1558
+ r: number;
1559
+ s: number;
1560
+ system: "cube";
1561
+ }>
1562
+ ```
1563
+
1564
+ #### CUBE_FLAT_N
1565
+
1566
+ <a id="api-cube-flat-n"></a>
1567
+
1568
+ ```typescript
1569
+ CUBE_FLAT_N: Readonly<{
1570
+ readonly q: 0;
1571
+ readonly r: -1;
1572
+ readonly s: 1;
1573
+ readonly system: "cube";
1574
+ }>
1575
+ ```
1576
+
1577
+ #### CUBE_FLAT_NW
1578
+
1579
+ <a id="api-cube-flat-nw"></a>
1580
+
1581
+ ```typescript
1582
+ CUBE_FLAT_NW: Readonly<{
1583
+ readonly q: -1;
1584
+ readonly r: 0;
1585
+ readonly s: 1;
1586
+ readonly system: "cube";
1587
+ }>
1588
+ ```
1589
+
1590
+ #### CUBE_FLAT_S
1591
+
1592
+ <a id="api-cube-flat-s"></a>
1593
+
1594
+ ```typescript
1595
+ CUBE_FLAT_S: Readonly<{
1596
+ readonly q: 0;
1597
+ readonly r: 1;
1598
+ readonly s: -1;
1599
+ readonly system: "cube";
1600
+ }>
1601
+ ```
1602
+
1603
+ #### CUBE_FLAT_SE
1604
+
1605
+ <a id="api-cube-flat-se"></a>
1606
+
1607
+ ```typescript
1608
+ CUBE_FLAT_SE: Readonly<{
1609
+ readonly q: 1;
1610
+ readonly r: 0;
1611
+ readonly s: -1;
1612
+ readonly system: "cube";
1613
+ }>
1614
+ ```
1615
+
1616
+ #### CUBE_NE
1617
+
1618
+ <a id="api-cube-ne"></a>
1619
+
1620
+ ```typescript
1621
+ CUBE_NE: Readonly<{
1622
+ readonly q: 1;
1623
+ readonly r: -1;
1624
+ readonly s: 0;
1625
+ readonly system: "cube";
1626
+ }>
1627
+ ```
1628
+
1629
+ #### CUBE_ORIGIN
1630
+
1631
+ <a id="api-cube-origin"></a>
1632
+
1633
+ ```typescript
1634
+ CUBE_ORIGIN: Readonly<{
1635
+ readonly q: 0;
1636
+ readonly r: 0;
1637
+ readonly s: 0;
1638
+ readonly system: "cube";
1639
+ }>
1640
+ ```
1641
+
1642
+ #### CUBE_POINTY_E
1643
+
1644
+ <a id="api-cube-pointy-e"></a>
1645
+
1646
+ ```typescript
1647
+ CUBE_POINTY_E: Readonly<{
1648
+ readonly q: 1;
1649
+ readonly r: 0;
1650
+ readonly s: -1;
1651
+ readonly system: "cube";
1652
+ }>
1653
+ ```
1654
+
1655
+ #### CUBE_POINTY_NW
1656
+
1657
+ <a id="api-cube-pointy-nw"></a>
1658
+
1659
+ ```typescript
1660
+ CUBE_POINTY_NW: Readonly<{
1661
+ readonly q: 0;
1662
+ readonly r: -1;
1663
+ readonly s: 1;
1664
+ readonly system: "cube";
1665
+ }>
1666
+ ```
1667
+
1668
+ #### CUBE_POINTY_SE
1669
+
1670
+ <a id="api-cube-pointy-se"></a>
1671
+
1672
+ ```typescript
1673
+ CUBE_POINTY_SE: Readonly<{
1674
+ readonly q: 0;
1675
+ readonly r: 1;
1676
+ readonly s: -1;
1677
+ readonly system: "cube";
1678
+ }>
1679
+ ```
1680
+
1681
+ #### CUBE_POINTY_W
1682
+
1683
+ <a id="api-cube-pointy-w"></a>
1684
+
1685
+ ```typescript
1686
+ CUBE_POINTY_W: Readonly<{
1687
+ readonly q: -1;
1688
+ readonly r: 0;
1689
+ readonly s: 1;
1690
+ readonly system: "cube";
1691
+ }>
1692
+ ```
1693
+
1694
+ #### CUBE_SW
1695
+
1696
+ <a id="api-cube-sw"></a>
1697
+
1698
+ ```typescript
1699
+ CUBE_SW: Readonly<{
1700
+ readonly q: -1;
1701
+ readonly r: 1;
1702
+ readonly s: 0;
1703
+ readonly system: "cube";
1704
+ }>
1705
+ ```
1706
+
1707
+ #### CW_120
1708
+
1709
+ <a id="api-cw-120"></a>
1710
+
1711
+ ```typescript
1712
+ CW_120 = 120
1713
+ ```
1714
+
1715
+ #### CW_180
1716
+
1717
+ <a id="api-cw-180"></a>
1718
+
1719
+ ```typescript
1720
+ CW_180 = 180
1721
+ ```
1722
+
1723
+ #### CW_240
1724
+
1725
+ <a id="api-cw-240"></a>
1726
+
1727
+ ```typescript
1728
+ CW_240 = 240
1729
+ ```
1730
+
1731
+ #### CW_300
1732
+
1733
+ <a id="api-cw-300"></a>
1734
+
1735
+ ```typescript
1736
+ CW_300 = 300
1737
+ ```
1738
+
1739
+ #### CW_60
1740
+
1741
+ <a id="api-cw-60"></a>
1742
+
1743
+ ```typescript
1744
+ CW_60 = 60
1745
+ ```
1746
+
1747
+ #### DOUBLE_H
1748
+
1749
+ <a id="api-double-h"></a>
1750
+
1751
+ ```typescript
1752
+ DOUBLE_H: "doubleH"
1753
+ ```
1754
+
1755
+ #### DOUBLE_H_N
1756
+
1757
+ <a id="api-double-h-n"></a>
1758
+
1759
+ ```typescript
1760
+ DOUBLE_H_N: Readonly<{
1761
+ readonly col: 0;
1762
+ readonly row: -2;
1763
+ readonly system: "doubleH";
1764
+ }>
1765
+ ```
1766
+
1767
+ #### DOUBLE_H_NE
1768
+
1769
+ <a id="api-double-h-ne"></a>
1770
+
1771
+ ```typescript
1772
+ DOUBLE_H_NE: Readonly<{
1773
+ readonly col: 1;
1774
+ readonly row: -1;
1775
+ readonly system: "doubleH";
1776
+ }>
1777
+ ```
1778
+
1779
+ #### DOUBLE_H_NW
1780
+
1781
+ <a id="api-double-h-nw"></a>
1782
+
1783
+ ```typescript
1784
+ DOUBLE_H_NW: Readonly<{
1785
+ readonly col: -1;
1786
+ readonly row: -1;
1787
+ readonly system: "doubleH";
1788
+ }>
1789
+ ```
1790
+
1791
+ #### DOUBLE_H_S
1792
+
1793
+ <a id="api-double-h-s"></a>
1794
+
1795
+ ```typescript
1796
+ DOUBLE_H_S: Readonly<{
1797
+ readonly col: 0;
1798
+ readonly row: 2;
1799
+ readonly system: "doubleH";
1800
+ }>
1801
+ ```
1802
+
1803
+ #### DOUBLE_H_SE
1804
+
1805
+ <a id="api-double-h-se"></a>
1806
+
1807
+ ```typescript
1808
+ DOUBLE_H_SE: Readonly<{
1809
+ readonly col: 1;
1810
+ readonly row: 1;
1811
+ readonly system: "doubleH";
1812
+ }>
1813
+ ```
1814
+
1815
+ #### DOUBLE_H_SW
1816
+
1817
+ <a id="api-double-h-sw"></a>
1818
+
1819
+ ```typescript
1820
+ DOUBLE_H_SW: Readonly<{
1821
+ readonly col: -1;
1822
+ readonly row: 1;
1823
+ readonly system: "doubleH";
1824
+ }>
1825
+ ```
1826
+
1827
+ #### DOUBLE_W
1828
+
1829
+ <a id="api-double-w"></a>
1830
+
1831
+ ```typescript
1832
+ DOUBLE_W: "doubleW"
1833
+ ```
1834
+
1835
+ #### DOUBLE_W_E
1836
+
1837
+ <a id="api-double-w-e"></a>
1838
+
1839
+ ```typescript
1840
+ DOUBLE_W_E: Readonly<{
1841
+ readonly col: 2;
1842
+ readonly row: 0;
1843
+ readonly system: "doubleW";
1844
+ }>
1845
+ ```
1846
+
1847
+ #### DOUBLE_W_NE
1848
+
1849
+ <a id="api-double-w-ne"></a>
1850
+
1851
+ ```typescript
1852
+ DOUBLE_W_NE: Readonly<{
1853
+ readonly col: 1;
1854
+ readonly row: -1;
1855
+ readonly system: "doubleW";
1856
+ }>
1857
+ ```
1858
+
1859
+ #### DOUBLE_W_NW
1860
+
1861
+ <a id="api-double-w-nw"></a>
1862
+
1863
+ ```typescript
1864
+ DOUBLE_W_NW: Readonly<{
1865
+ readonly col: -1;
1866
+ readonly row: 1;
1867
+ readonly system: "doubleW";
1868
+ }>
1869
+ ```
1870
+
1871
+ #### DOUBLE_W_SE
1872
+
1873
+ <a id="api-double-w-se"></a>
1874
+
1875
+ ```typescript
1876
+ DOUBLE_W_SE: Readonly<{
1877
+ readonly col: 1;
1878
+ readonly row: 1;
1879
+ readonly system: "doubleW";
1880
+ }>
1881
+ ```
1882
+
1883
+ #### DOUBLE_W_SW
1884
+
1885
+ <a id="api-double-w-sw"></a>
1886
+
1887
+ ```typescript
1888
+ DOUBLE_W_SW: Readonly<{
1889
+ readonly col: -1;
1890
+ readonly row: 1;
1891
+ readonly system: "doubleW";
1892
+ }>
1893
+ ```
1894
+
1895
+ #### DOUBLE_W_W
1896
+
1897
+ <a id="api-double-w-w"></a>
1898
+
1899
+ ```typescript
1900
+ DOUBLE_W_W: Readonly<{
1901
+ readonly col: -2;
1902
+ readonly row: 0;
1903
+ readonly system: "doubleW";
1904
+ }>
1905
+ ```
1906
+
1907
+ #### EVEN_Q
1908
+
1909
+ <a id="api-even-q"></a>
1910
+
1911
+ ```typescript
1912
+ EVEN_Q: "evenQ"
1913
+ ```
1914
+
1915
+ #### EVEN_R
1916
+
1917
+ <a id="api-even-r"></a>
1918
+
1919
+ ```typescript
1920
+ EVEN_R: "evenR"
1921
+ ```
1922
+
1923
+ #### FLAT
1924
+
1925
+ <a id="api-flat"></a>
1926
+
1927
+ ```typescript
1928
+ FLAT = "flat"
1929
+ ```
1930
+
1931
+ #### HEX_CORNERS
1932
+
1933
+ <a id="api-hex-corners"></a>
1934
+
1935
+ ```typescript
1936
+ HEX_CORNERS: readonly HexCorner[]
1937
+ ```
1938
+
1939
+ #### HEX_CUBE_DIRECTIONS
1940
+
1941
+ <a id="api-hex-cube-directions"></a>
1942
+
1943
+ ```typescript
1944
+ HEX_CUBE_DIRECTIONS: Readonly<HexCubeDirection[]>
1945
+ ```
1946
+
1947
+ #### HEX_SYSTEMS
1948
+
1949
+ <a id="api-hex-systems"></a>
1950
+
1951
+ ```typescript
1952
+ HEX_SYSTEMS: readonly HexSystem[]
1953
+ ```
1954
+
1955
+ #### ODD_Q
1956
+
1957
+ <a id="api-odd-q"></a>
1958
+
1959
+ ```typescript
1960
+ ODD_Q: "oddQ"
1961
+ ```
1962
+
1963
+ #### ODD_R
1964
+
1965
+ <a id="api-odd-r"></a>
1966
+
1967
+ ```typescript
1968
+ ODD_R: "oddR"
1969
+ ```
1970
+
1971
+ #### OFFSET_DIRECTIONS
1972
+
1973
+ <a id="api-offset-directions"></a>
1974
+
1975
+ ```typescript
1976
+ OFFSET_DIRECTIONS: Readonly<Readonly<OffsetDirection>[]>
1977
+ ```
1978
+
1979
+ #### OFFSET_Q_N
1980
+
1981
+ <a id="api-offset-q-n"></a>
1982
+
1983
+ ```typescript
1984
+ OFFSET_Q_N = 2
1985
+ ```
1986
+
1987
+ #### OFFSET_Q_NE
1988
+
1989
+ <a id="api-offset-q-ne"></a>
1990
+
1991
+ ```typescript
1992
+ OFFSET_Q_NE = 1
1993
+ ```
1994
+
1995
+ #### OFFSET_Q_NW
1996
+
1997
+ <a id="api-offset-q-nw"></a>
1998
+
1999
+ ```typescript
2000
+ OFFSET_Q_NW = 3
2001
+ ```
2002
+
2003
+ #### OFFSET_Q_S
2004
+
2005
+ <a id="api-offset-q-s"></a>
2006
+
2007
+ ```typescript
2008
+ OFFSET_Q_S = 5
2009
+ ```
2010
+
2011
+ #### OFFSET_Q_SE
2012
+
2013
+ <a id="api-offset-q-se"></a>
2014
+
2015
+ ```typescript
2016
+ OFFSET_Q_SE = 0
2017
+ ```
2018
+
2019
+ #### OFFSET_Q_SW
2020
+
2021
+ <a id="api-offset-q-sw"></a>
2022
+
2023
+ ```typescript
2024
+ OFFSET_Q_SW = 4
2025
+ ```
2026
+
2027
+ #### OFFSET_R_E
2028
+
2029
+ <a id="api-offset-r-e"></a>
2030
+
2031
+ ```typescript
2032
+ OFFSET_R_E = 0
2033
+ ```
2034
+
2035
+ #### OFFSET_R_NE
2036
+
2037
+ <a id="api-offset-r-ne"></a>
2038
+
2039
+ ```typescript
2040
+ OFFSET_R_NE = 1
2041
+ ```
2042
+
2043
+ #### OFFSET_R_NW
2044
+
2045
+ <a id="api-offset-r-nw"></a>
2046
+
2047
+ ```typescript
2048
+ OFFSET_R_NW = 2
2049
+ ```
2050
+
2051
+ #### OFFSET_R_SE
2052
+
2053
+ <a id="api-offset-r-se"></a>
2054
+
2055
+ ```typescript
2056
+ OFFSET_R_SE = 5
2057
+ ```
2058
+
2059
+ #### OFFSET_R_SW
2060
+
2061
+ <a id="api-offset-r-sw"></a>
2062
+
2063
+ ```typescript
2064
+ OFFSET_R_SW = 4
2065
+ ```
2066
+
2067
+ #### OFFSET_R_W
2068
+
2069
+ <a id="api-offset-r-w"></a>
2070
+
2071
+ ```typescript
2072
+ OFFSET_R_W = 3
2073
+ ```
2074
+
2075
+ #### ORIENTATION_FLAT
2076
+
2077
+ <a id="api-orientation-flat"></a>
2078
+
2079
+ ```typescript
2080
+ ORIENTATION_FLAT: Readonly<HexOrientation>
2081
+ ```
2082
+
2083
+ #### ORIENTATION_POINTY
2084
+
2085
+ <a id="api-orientation-pointy"></a>
2086
+
2087
+ ```typescript
2088
+ ORIENTATION_POINTY: Readonly<HexOrientation>
2089
+ ```
2090
+
2091
+ #### POINTY
2092
+
2093
+ <a id="api-pointy"></a>
2094
+
2095
+ ```typescript
2096
+ POINTY = "pointy"
2097
+ ```
2098
+
2099
+ #### QRS_ORIGIN
2100
+
2101
+ <a id="api-qrs-origin"></a>
2102
+
2103
+ ```typescript
2104
+ QRS_ORIGIN: Readonly<{
2105
+ readonly q: 0;
2106
+ readonly r: 0;
2107
+ }>
2108
+ ```
2109
+
2110
+ #### SQRT_3
2111
+
2112
+ <a id="api-sqrt-3"></a>
2113
+
2114
+ ```typescript
2115
+ SQRT_3: number
2116
+ ```
2117
+
2118
+ #### SQRT_3_2
2119
+
2120
+ <a id="api-sqrt-3-2"></a>
2121
+
2122
+ ```typescript
2123
+ SQRT_3_2: number
2124
+ ```
2125
+
2126
+ #### SQRT_3_3
2127
+
2128
+ <a id="api-sqrt-3-3"></a>
2129
+
2130
+ ```typescript
2131
+ SQRT_3_3: number
2132
+ ```
2133
+
2134
+ #### TWO_PI
2135
+
2136
+ <a id="api-two-pi"></a>
2137
+
2138
+ ```typescript
2139
+ TWO_PI: number
2140
+ ```
2141
+