# Deciding whether a set of points on a 2D plane has axial symmetry [closed]

The problem to solve:

Let's say we have a set of $$n$$ points on the 2D plane. Determine whether it has axial symmetry.

My attempt so far:

For n=2 the answer is trivially "yes". For n=3 symmetry exists only if these points are the vertices of an isosceles triangle. For n=4, the points must be the sides of a square, rhombus or isosceles trapezoid for there to be axial symmetry. Also for n=4 there is a non-convex quadrilateral for which the axial symmetry can be found.

Question

My approach above is not very formal. ​How can one write an algorithm to determine whether a set of points has axial symmetry?

• What is central symmetry? Dec 14, 2023 at 10:55
• @justhalf, thanks you, I meant the axial symmetry.
– Nick
Dec 14, 2023 at 11:48
• Thanks for the edit. Any regular n-gon has axial symmetry, though, so what exactly are you asking? Dec 14, 2023 at 11:53
• @justhalf, i don't have a regular n-gon. In the common case n points have random coordinates.
– Nick
Dec 14, 2023 at 12:13
• The algorithm is given in this math.se answer and is very similar to the method described in this 1985 paper by Wolter et al. Dec 14, 2023 at 13:34

There may very well be a more elegant way to do this, but you can easily brute force mirror symmetry (which is what you call axial symmetry in 2D as long as the symmetry axis lies in the same plane) for a finite number of distinct points on a 2D plane:

First, check for the degenerate case: if all the points lie on the same line, then that line is a symmetry axis. (Even if it is, there may be another axis; following the general method below will find it if it exists.)

Then, pick a point in the point set. If there is mirror symmetry, then exactly one of these two statements is true for every axis of symmetry:

1. The symmetry axis is exactly halfway between this point and some other point, perpendicular to the line segment connecting the points.
2. The symmetry axis passes through this point.

The first case provides a finite number of candidates for the axis of symmetry, and the second case creates an easily verifiable constraint. Since an actual symmetry axis will need to satisfy one of the two conditions for all the points in the set, you can then repeat the procedure for all the other points, and doing so will (very likely) rule out most of the candidates very quickly.

Once you have repeated the process for all the points, eliminating any candidate that doesn't work for every point, any line that still is a candidate actually is a symmetry axis.

For point symmetry, a similar method works, but now the steps are even simpler: first of all, with a finite number of points, there can be at most one point of symmetry, and furthermore, there are no degenerate cases to consider. The rules for the candidate centre points of symmetry to consider for each point are

1. the midwaypoint from that point to another, and
2. the point itself

so there won't be any need for considering constraints, and the candidates will get ruled out extremely quickly.

The point symmetry is a special case of axial symmetry: the axis is now perpendicular to the plane, and the rotation is 180 degrees.

For a generic rotation about an axis that is perpendicular to the plane, following the similar method will get messy, so you'll need to be a bit more clever: if there is a centre point of symmetry, it will be at the "centre of mass" of the points. So add up every x-coordinate and divide by the number of points, and do the same for the y-coordinates, and you have the coordinates for the only candidate point that could be the centre of rotation.

Then consider each subset of points that are at the same non-zero distance from the candidate centre, and see if you can divide every subset into regular n-gons, all with the same n. If (and only if) you can, then you have n-fold rotational symmetry around an axis that is perpendicular to the plane, intersecting it at the "average point" found earlier.

• For point symmetry the only candidate is the average of all points, or center of gravity. Dec 15, 2023 at 21:44