Cellular Conquest

A strategic game of Loci and Voronoi Diagrams based on Euclidean Distance.

P1 (Red)

0.0%
Territory Control
Red Player's Turn
Moves: 0

P2 (Blue)

0.0%
Territory Control

How to Play

  • Players take turns placing bases (dots) on the map.
  • Territory is divided using Euclidean distance.
  • Hover your mouse to preview your move's mathematical impact!
  • Turn on Bisectors to see Voronoi edges form.
  • Capture the most territory to win!

Teacher's Note: The Mathematics Inside

This simulation generates a Voronoi Diagram in real-time. The algorithm finds the closest base (\(d_1\)) and second closest base (\(d_2\)) for every pixel. To draw perfectly uniform borders, we calculate the exact perpendicular distance \(D\) from any pixel to the boundary line using the difference of squared distances: $$ D = \frac{d_2^2 - d_1^2}{2 \times \text{distance between bases}} $$ By using this exact geometric distance, the perpendicular bisectors maintain a perfectly sharp, uniform thickness everywhere on the canvas!