Battle analysis

Battle Analysis is a research tool to analyze historical conflicts

These simulations are wargames in which the tactics and variables are modified to observe the different outcomes.

map

The battlefield consists of a wargame map with counters to represent military units. The wargame map and counters are images on the screen. The mouse is used to select counters and map coordinates. A hexagon grid is superimposed over the wargame map.

The HexagonPointCalculator is a set of methods to calculate the hexagon point coordinate from the battlefield image pixel coordinates. It is based on the Cartesian Coordinate System from Analytical Geometry.

   How the HexagonPointCalculator works is described at HexagonPointCalculator.html

The HexagonNameCalculator calculates the name of the hexagon using the hexagon point coordinates.

Note: hexagon names are NOT coordinates. See hexagonName.html


[screen pixels] ← (HexagonPointCalculator) → < hexagon point > ← (HexagonNameCalculator) → hexagon name


 

Programming Notes

The HexagonPointCalculator a set of methods based on the cartesian coordinate system to convert mouse events into a coordinate.

HexagonPoint

As the mouse moves over the map, the movement into and out of hexagons will be calculated. The hexagon will be identified by the coordinate of the hexagon center. This coordinate will be called the Hexagon Point. This Hexagon Point is used for wargame calculations.

HexagonName

However, wargames use a naming convention to label hexagons. As the mouse moves over the hexagon, it's hexagon name is calculated with the HexagonNameCalculator and shown on the map.

GridPoint

As the mouse moves over the map, The movement over a hexside is also calculated. The hexside is identified by the coordinate of the center of the hexside line and is called the Grid Point. If the mouse moves over the center of the hexagon, its coordinate is calculated as a connecting point between hexsides. The GridPoint can be either a hexside or a center that is connecting 2 hexsides.

VertexPoint

As the mouse moves over the map, The movement over a hexagon corner is also calculated. The corner is called the Vertex Point

The hexagon name is not a coordinate Use Analytical Geometry.