I am looking for methods (numerical measures actually) to determine how similar rectangles are to squares. Given a set of different rectangles, I need to find a few numerical measures that will sort the rectangles by their similarity to squares. One trivial method is the ratio between the vertices of the rectangle. If the ratio is 1, it is a square, and the closer it is to 1, the closer it is to a square. The characteristic that makes it a good measure, is that for similar rectangles, I will get the same score. I want to ask you to advice me with other alternative measures, that will keep the similarity characteristic (it can involve diagonals, angles, etc,...). In addition, I wanted to ask if such a measure exist that will allow to sort a general parallelogram by how close it is to a square. Thank you in advance.
2026-04-24 14:50:09.1777042209
On
Measuring Similarity of Geometrical Shapes
319 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
6
On
determine how similar rectangles are to squares
You'll need to quantify how you measure how similar in order to compare any "similarity scores".
For an example, let $S$ be the area of an arbitrary quadrilateral, $p$ be its perimeter, and $a=p/4$ be the average of side lengths. Then $q = S / a^2$ will be maximized for a square with a value of $q=1\,$. Also, the "score" $q$ will be the same between similar rectangles, and in fact between any similar quadrilaterals. However, this is but one way to quantify "closeness to square" between dissimilar rectangles, rhombi, parallelograms etc, so it is only one possible answer among many others.
Some measures for rectangles:
Please note, that all these measures are invariant to scaling. For example, given some measure you can construct a rectangle with the given measure (and, say, constant perimeter). In particular, for any above measure, that measure is the same for some two rectangles if and only if they are similar. Also, if you were given a one measure, you can calculate all others, so all above measure give the very same ordering of rectangles (modulo ascending/descending direction).
As for parallelograms, things are more complicated, because you have now two degrees of freedom (ratio of sides and the angle between sides). Which one is more important to you? Imagine two quadrilaterals: a rhombus and a rectangle, each only slightly off. Which one is more square? We can find a measure such that all similar parallelograms have same measure, but there will be two non-similar parallelograms with the same measures. Thus, let $\lambda \in [0,1]$ be a parameter which says what is more important to you, the difference between sides, or how right-angled it is (let's assume that $\lambda = 0$ means the sides ratio is the most important and the angle is irrelevant). Thus, for any two similarity measures $\mu_\mathrm{sides}, \mu_\mathrm{angle}$ with same base (i.e., whether perfect square is at $0$ or $1$, etc.) and direction (i.e., whether bigger measure means more or less square) you can take $$\lambda\cdot\mu_\mathrm{sides} + (1-\lambda)\cdot\mu_\mathrm{angle}.$$ To give you some measures for the $\mu_\mathrm{angle}$, you can use angle between sides (or some function of it), or just any of the above with the lengths of diagonals instead of lengths of sides. Combining the two, here are some concrete examples:
Please remember that combining the two measures will work well only if the "perfect square" value is the same, and they have roughly the same scale. Unless you know exactly what are you doing, do not join ranges like $(0,1)$ and $(1,\infty)$ together in this way (you can always use some transformations like $\exp$, $\tanh$, $\arctan$, $\frac{1}{x}$, $\frac{1}{1+x}$, etc.).
I hope this helps $\ddot\smile$
Edit: Sorry for the late edit, got interrupted.