Say I have two line segment paths, such as a subset of the examples below. How can I quantify the difference between them?
The two paths may have a different number of segments, and the length of each segment and the angle between them is variable.
I was thinking it would be good to establish a coordinate system and define the segments as nodes and edges. The difference could perhaps be quantified by the operations needed to transform one into the other, similar to the Levenshtein distance algorithm. Unfortunately the operation space is huge. Any ideas? Thanks!
I'll go a bit further than what @awoodland pointed out: how you quantify it depends entirely on why you want to quantify the difference.
Are you looking to come up with a unique (at least, likely to be unique) number like a hash code for a line segment path? Or are you trying to quantify line segment paths to say, "this path is more complex (or longer, or has more acute angles) than that path"?
If you want to create a hash code, I would suggest creating two 32-bit CRCs (or something similar): one for the segment lengths and one for the angles. Once you've computed those CRCs, put them together in a 64-bit value with the angles in the high 32 bits and the lengths in the low 32 bits. Depending on the number of segments, perhaps a single CRC value would do: for each segment, add the length and then the angle between it and the next segment.
Note that the above is likely to give you a unique number for each path, but not guaranteed to.
If you want to quantify the complexity of the line segment path ... I don't have a lot of ideas.