Formalizing "the symmetry group of a non-square rectangle" On Wikipedia I read that the Klein four-group is "the symmetry group of a non-square rectangle". I wonder about how to formalize this. The Wikipedia article on "Symmetry group" describes the symmetry group of a geometric object as

the group of all transformations under which the object is invariant, endowed with the group operation of composition. [...]

This is not satisfying for me, because, what is a transformation under which the non-square rectangle is invariant? But the article goes on saying:

For an object in a metric space, its symmetries form a subgroup of the isometry group of the ambient space.

This suggests the idea of defining the "non-square rectangle" formally as a metric space: let $X$ be the set of all points $(x, y)\in\mathbb R^2$ such that
$$((-2<x<2)\land (y=0))\lor ((x=-2)\land (0\leq y\leq 1))\lor((x=2)\land(0\leq y\leq 1))\lor((-2<x<2)\land(y=1)).$$
Then $X$ equipped with the standard 2d metric defined by $d((x, y), (x', y'))=\|(x-x', y-y')\|$ is a metric space.
Now my question is: Does the group of all isometries of $X$, i.e., all bijective maps $f\colon X\to X$ which are distance-preserving in the sense that
$$d(f(x, y), f(x', y'))=d((x,y), (x', y'))$$
for all $(x,y),(x',y')\in X$, coincide with what is informally called the "symmetry group of a non-square rectangle"?
To state a more precise question: does each isometry (as defined above) of $X$ map vertices to vertices? By edge, I mean one of the four points $(2, 0)$, $(2, 1)$, $(-2, 0)$ and $(-2, 1)$. I ask this question because I think symmetries of geometric shapes are generally described as a permutation of only the vertices of the geometric shape.

Yes, "isometry" here is the same as what Wikipedia means by "symmetry". To answer your question about whether isometries send vertices to vertices, the answer is also yes. For instance, the vertices of your rectangle are uniquely specified as the points of the rectangle which have another point at distance $\sqrt {17}$. An isometry must preserve this.
