Similar to HexGridSphere, GeographyExample, HexGridIcosahedron.
Goals:
- A cell-based grid, suitable for playing Civilization-like games.
- Each cell has approximately the same area (+/- 15 % is very good).
- Each cell has approximately the same shape in the real world. (+/- 15 % is very good, in each direction that motion is allowed.)
- Cities can tile the world, without having their hinterlands overlap.
- The grid can be subdivided iteratively (that is, fractally).
Goals where coming close is good enough:
- Most cells have the same number of neighbors. 6 in this solution; 12 cells have 5 neighbors.
Proposed solution:
- Use an equal-area projection to project a sphere's Northern hemisphere onto the top of a hexagon. (Australians can project the Northern hemisphere onto the bottom of the hexagon.)
- Use an equal-area projection to project the sphere's Southern hemisphere onto the bottom of the hexagon. (Australians can project the Southern hemisphere onto the top of the hexagon.)
- Now that the sphere has been projected onto a 2-sided hexagonal disk, cover each surface with a hex-grid. That's a weird way to look at this problem. These two hexagons, when bent into hemispheres, can be made to fit together perfectly geometrically. True. However, they can't be put together in such a way that the structure of the hexgrid is preserved and homogeneous over the whole sphere. When tiling a sphere with cells that all have the same shape, it is impossible to make a mesh in which each node connects the same number of edges. True -- the non-homogeneous cells are described below in "Cell Neighbors". Therefore, when displaying a part of the world in a Civilization-like game, that part can never go across the equator, which is pretty annoying. Actually, the viewport can cross the equator, as described below in "Rips in the Map". Is this solution really suitable for playing Civ-like games? If you are willing to live with a StarOfDavid?-like globe, it is suitable. If you are not willing to live with rips in the map, you can find another solution. (Note that this solution lets you view half of the world at a time without seeing any rips.) If you want to have tiles that all are the same shape, of course there have to be rips. But I still hope there is some really witty trick that makes them unnoticeable. Maybe it would be enough if that that trick wouldn't work with an arbitrary globe, but with our earth. If you take one of the solutions that have just a couple of single tiles that are pentagons instead of hexagons, maybe you could hide them somehow, place them in the middle of oceans?
- The size of the hex-grid can be chosen to let cities' hinterlands tile perfectly.
- This solution will be equal-area, but have large distance distortions. (The equator will be 50% longer than the shortest great-circle route over the poles.)
Cell Neighbors
Unfortunately, the two hexagons can't be put together in such a way that the structure of the HexGrid? is preserved and homogeneous over the whole sphere. When tiling a sphere with cells that all have the same shape, it is impossible to make a mesh in which each node connects the same number of edges.
- Most cells have 6 neighbors:
- North
- Northwest
- Northeast
- Southwest
- Southeast
- South
- The longest meridians (the ones that run from corner-to-corner of the hexagons) have some special cases:
- The north pole has 6 neighbors, all to the south.
- The south pole has 6 neighbors, all to the north.
- The most cells along these meridians have 6 neighbors:
- Northwest
- Northeast
- West
- East
- Southwest
- Southeast
- The 6 cells at the corners of the northern hexagon have 5 neighbors:
- Northwest
- Northeast
- West
- East
- South -- 2 edges touch the corner of the southern hexagon
- The 6 cells at the corners of the southern hexagon have 5 neighbors:
- North -- 2 edges touch the corner of the northern hexagon
- West
- East
- Southwest
- Southeast
Rips in the Map
- The user can zoom in and pan normally through any part of the map, except the corners of the hexagons. (They can even pan through most of the equator.)
- Displaying the region around the corners of the hexagons requires some work-arounds. The map is ripped here; a total of 120 degrees of map is missing.
- Perhaps the rip can be located between the corner cells and the nearest edge of the viewport.
- Perhaps a symbol (like stretched taffy) can be used to link adjoining cells (or halves of cells) on opposite sides of the rip.
- Perhaps if the user pans so that the corner cells are closer to a different edge of the viewport, the rip will suddenly "jump" to the new edge of the viewport.
- If the user zooms out to view the whole map, it will look like a StarOfDavid?.
The size of the hex-grid can be chosen to let cities' hinterlands tile perfectly.
If each city has a hinterland with a radius of 2 cells, then the city can use a total of 19 cells (including its own cell).
Hex-grids can tile a plane: Each sub-grid has 6n neighbors (e.g., n/a, 6, 12, 18...). Each grid contains 1 + 6*(n+) sub-grids (e.g., 1, 7, 19, 37...)
The hex-grids do not tile a hexagon. Some of the grids extend slightly out-of-bounds; in other places, there are equal-sized gaps at the edges. These excesses and gaps are complementary, so that:
The hex-grids tile the disk.
Some convenient numbers of cells for the world:
disks div- hinter total cell hinterland notes
isions land cells area radius(es)
------------------------- ---- ---------- -----
2 * 1 = 2 (a trivial world)
2 * 7 = 14 1 (a 2-city world)
2 * 19 = 38 2 (a 2-city world)
2 * 7 * 19 = 266 1,2 (a small world)
2 * 19 * 19 = 722 2
2 * 7 * 7 * 19 = 1862 270,000 km^2 1,2
2 * 37 * 37 * 19 = 52022 9,800 km^2 2,3 (each cell is about 1° across)
The Earth has an area of about 510,000,000 km^2
Formulas for a polar Lambert equal-area projection onto the hexagon:
Each meridians is a straight line.
Each parallel (of constant latitude) is a hexagon centered on the pole.
When measured along a parallel, the scale is constant.
distance from center to point
Let beta = --------------------------------
distance from center to equator,
along the same meridian
sin(latitude) = 1 - (beta)^2
Error estimates:
Assume that the Earth is a sphere with a 40,000 km equator. (The error in treating the Earth as a sphere instead of an ellipsoid is negligible compared to the error in the HexGridDisk.)
This sphere has an area of 509,300,000 km^2
Each degree (along a great circle) has a length of 111.111... km
The HexGridDisk has an area of 509,300,000 km^2
(by the equal-area assumption).
Each degree (along the equator) has a length of 165 km.
Assume that the shortest meridians are at 0, 60, 120... degrees longitude.
Degrees measured along short meridians range in length
from 75 km to 106 km.
The longest meridians are at 30, 90, 150... degrees longitude.
Degrees measured along long meridians range in length
from 86 km to 122.2 km.
Thus, the worst linear distortion is at the equator,
where some distances are 48.5 % too long,
and some distances are 32.7 % too short.
If the boundaries of the cells are suitable fractals, the grid can be iteratively (that is, fractally) subdivided.
A SquareGridDisk? can also be built. It will have greater distortion, as the equator will be twice as long as the great circle route over the poles.
Discussion:
See also: AustralianCulturalAssumption, HexGridSphere, HexGridIcosahedron, GeographyExample