Now I have two scores. One for similarities between points and one for similarities between the line angles. I need to be able to weight them so I need to know their extents.
For the point comparison I have 32 points within a 1x1 rectangle. The farthest apart they could possibly be is √2. So the highest possible score is 32√2. But each point is weighted so there’s an average weight of 0.5 so 16√2. That’s still way higher than I ever see in my tests. I don’t think I’ve seen anything higher than 3 or 4. In this case, theory definitely doesn’t meet practice.
On the other metric, 32 points that can be as much as π apart gives me a high of 50. But the algorithm is trying to match up the points as best as possible so that’s technically impossible.
…
New problem: I need to take into account the relative rotation of the input shape and the template. The turning functions give angles relative to the x-axis so I can’t compare shapes unless their axes are aligned.
In the outputs above, the rainbow has a good score with 5 compared to the others 25-31. The inverted rainbow, however, is just as bad or worse than the other entries.
This can also be seen with a triangle but after the fix it works well:
And the rainbow after the fix:
…
And here I’m torturing the algorithm with scenarios that are in-between.