I suspect the mathematical analysis could be even simpler. Here's one idea:
View each track piece as a 2d vector. Add up the vectors. In a zero-tension setup, the sum is (0, 0).
As a metric for tension, assume any mismatch in position is evenly distributed. Model this as the average of all the vectors. (Thus the same displacement is more meaningful when we have fewer pieces.)
___
That's the full idea. It might seem that it is ignoring rotation, because it doesn't explicitly mention rotations, but they are included because the effective vector that a track piece provides is both a current direction as well as the displacement contributed by that piece. If we wrote some code to model this, a cursor would consist of a direction (an angle) along with an (x, y) position.
___
Some related math concepts:
* The exterior angles of a polygon sum to 360. So we could have another measure which is how far we are away from 360.
* Not useful in this case, but this also reminds me of winding numbers from complex analysis, which is a way to locally walk along a curve to understand which side is the "inside" or how many times a curve goes around a given point.
I don't have a quantitative argument, but my intuition is that it might still be possible to make a track that globally has no net tension, yet still has "local" tension somewhere. This might be done by creating a shape that slightly intersects itself, pushing that section into tension, while a complementary section sums to the negative of the first section but without self-intersection.
To expand on the angles of a polygon idea. It looks like each of these tracks has about a 30 degree bend. So you should have 360/30 = 12 more right-handed than left-handed tracks, or vice versa. It takes some counting, but you could probably get pretty quick at going around the track and adding or subtracting 1. If you end at 12, perfect. Your distance from 12 is an estimator for tension.
This is necessary but not sufficient for there to be no tension. For example, if you have 12 curved pieces, all curving in the same direction, and one straight piece, there will be tension.
To give the answer credit, that answer does suggest adding the vectors (the same). It is also much more thorough than what I said, and I like the images. I like the answer and I was attempting to iterate.
I think these two things could be improved from that answer:
* I'm suggesting a general approach to measuring track tension, which is the average of the vectors. I didn't see that idea in the answer.
* I think the answer could be communicated a little more simply. For example, we don't need to think in terms of Q[sqrt(3)]; I see that as a distraction.
> For example, we don't need to think in terms of Q[sqrt(3)]; I see that as a distraction.
Except for replacing Q[sqrt(3)] by a suitable ring extension of Z, I see no possibiliy to simplify the argument. So what kind of simplification do you have in mind?
You're speaking as if floating point representations of numbers have zero utility. One approach here could be numerical. An algorithm could work with vectors represented as floating points. Another approach, which depends on the relative angles and lengths of track pieces, may be to encode each piece as an (angle, distance^2) pair. Many angles can give us an exact distance^2 values.
Ok, a snarky way to phrase things, but it's a good point - in general the vectors could add to zero and the angles may not align. So perhaps a better expression may be
a metric for tension = [ norm(sum(piece_vectors)) + abs(angle_displacement) ] / n
Counterexample: a dozen (+1, 0) tiles followed by a dozen (-1, 0) tiles. Vector sum is fine, total angle is fine, but at each end you have an impossible 180 deg connection. I don’t think you can get away from local measures of tension with a global look.
View each track piece as a 2d vector. Add up the vectors. In a zero-tension setup, the sum is (0, 0).
As a metric for tension, assume any mismatch in position is evenly distributed. Model this as the average of all the vectors. (Thus the same displacement is more meaningful when we have fewer pieces.)
___
That's the full idea. It might seem that it is ignoring rotation, because it doesn't explicitly mention rotations, but they are included because the effective vector that a track piece provides is both a current direction as well as the displacement contributed by that piece. If we wrote some code to model this, a cursor would consist of a direction (an angle) along with an (x, y) position.
___
Some related math concepts:
* The exterior angles of a polygon sum to 360. So we could have another measure which is how far we are away from 360.
* Not useful in this case, but this also reminds me of winding numbers from complex analysis, which is a way to locally walk along a curve to understand which side is the "inside" or how many times a curve goes around a given point.