Triangulating Polygons, Again

28.07.2026
Click on the canvas below to draw a point. Press \(\,\)c \(\,\)on your keyboard to close the the polygon when finished and \(\,\)t \(\,\) to triangulate the closed polygon. Hit \(\,\)r \(\,\) to reset.

Now with 2-2 moves!

The javascript canvas above is built off of an old project of mine where I implement an algorithm that triangulates any polygon, keeping the vertices of the triangles on the vertices of the polygon. It's not a difficult algorithm, but it's fun to play around with. I wanted to update it so that you can now click on and edge to perform a 2-2 move. This allows you to change the triangulation. Observe that you can't perform a 2-2 move if the introduced edge would leave the polygon, and so you can only perform geometric 2-2 moves.

It's interesting to think about when a geometric 2-2 move can't happen. If you have a polygon (with more than three vertices and necessarily non-convex) which admits no geometric 2-2 move, does it admit any other triangulations? It's not difficult to come up with many examples of polygons which admit no geometric 2-2 move, but it seems hard to me to answer that question. I want to explore this in a future post.

P.S. try hitting \(\,\)d \(\,\) on the canvas above after triangulating a complicated polygon.