Given points on a 2D plane, what kind of metrics can be used to define if they closely fit either:
- triangle
- square or rectangle
- circle
- oval (circular but not oval)
(Image credit: StyleCraze.com "How to Determine the Shape of Your Face".)
Note thanks to John Gowers on Meta for trying to help clarify parts of my old question, which was closed.

All of these shapes can be parameterized by a small set of parameters (assuming that you mean "ellipse" when you say "oval"). For example, a square can be parameterized by a side length and an angle of rotation: 2 parameters. You can create four different optimization algorithms, one for each shape. Each algorithm fits a shape to the set of points. For these algorithms, you will need to choose an optimization metric. An example might be the sum of distances between points and nearest location of shape. The residual (the best value of the optimization metric) will tell you how well each shape fits the set of points. The shape with the lowest metric fits the set of points best.