Marching Squares is a 2D variation of the 3D Marching Cubes algorithm
For my implementation in 2D, I used ancient OpenGL (GLUT was required for the project) and C++. There is a grid of MarchingSquare objects which contain 4 vertices, each specified by a 3D vector. There is also a list of shapes, all circles in this case, which bounce around the scene as they collide with an invisible boundary object.
The grid is searched for a square that contains each circle's center, and then the surrounding square states are calculated based on which vertices are encompassed by that cirlce. In the draw function, the state of each active square is used to pull a set of vertices from a lookup table. The vertices are then sent through the OpenGL pipeline and rendered on screen. The result is the approximation of the circles as they pass over a given section of the grid.
More information about Marching Cubes on Wikipedia: Marching Cubes
If you'd like to see the code, check it out on GitHub.
Approximating Shapes with Squares and Partial Squares
Approximation of the Underlying Grid