I was helping my two year old son build a train track yesterday. (He is unbelievably cute and has an inexplicable fascination with all things to do with transport.) Anyway as I was attempting to configure all the track sections to make a closed loop, a question occurred to me.
I know that for a polygon such as might be required for an orienteering course, each leg of the journey can be defined using a vector. The direction of the vector has an absolute frame of reference. The condition for forming a closed polygon is that the sum of all the vectors is zero. Simple.
Not so with the train set. The magnitude of each section is fixed but the direction is in relation to the direction being faced at the end of the previous track section. As well as this there is an angle of turning associated with each track section.
Whether the track forms a closed loop is dependent not only on the track pieces used but also the order in which they are connected. The situation is non-commutative.
Now I am sure that I could work out some system for representing the track pieces in some kind of vector or matrix notation but it occurs to me that it has probably been done before. Is there a simple standard notation that would work for such a system? Under this system, what are the conditions for forming a closed loop? It seems to me that quaternions might be useful here but I have no real experience with them beyond an introduction to the idea.
Thoughts? Ideas?