Line is array of points (2 or more). I have a plane full of lines. For a given line in plane I need a measure which will tell how much difference there is between this and any other line in plane. I need this measure to be 0 when lines are exactly the same and on same place, and its value must increase if other line is same but on other location or if other line has different geometry.

My usage is this: I have a road with approximate geometry. I have a road network. I must find another road in road network which is probably the road I am searching for. But for some other reasons, i require this measure also. It is not enough to find the road, I must give a number which tells how much is my match good and how close are other matches.

So i need advice for algorithm that solves my problems.

Notice that two lines do not have to be different if some of their points are different.

Also if someone has code or library that does this in C# it would be splendid.

-
In a sense, all of the lines in a plane are alike. Perhaps you are really interested in comparing the difference between two different arrangements of n lines in the plane? Take a look at: en.wikipedia.org/wiki/Arrangement_of_lines – Joseph Malkevitch Nov 29 '11 at 16:35
I was very vague, I hope my question is clearer now. – watbywbarif Nov 29 '11 at 17:13
There are many ways you could define a difference between lines. but it sounds like you're really trying to compare line segments ? – Suresh Venkat Dec 4 '11 at 7:36
Yes, comparing line segments is precise ;) My approximate geometry is array of points, and I would like to match this points to line segments in network (one or more). – watbywbarif Dec 4 '11 at 10:58