I need an algorithm to calculate, numerically, the degree of similarity between two drawn lines. The lines are drawn using a mouse, and are stored as a set of cartesian coordinates before being filtered and smoothed using separate algorithms.
For example, within the following diagram:
Lines A and B are clearly similar, but B and C are not. The algorithm should reflect this. Additionally, the 'direction' of the line, as indicated by the start and end points, matters. Does such an algorithm already exist?