Colin Henderson wrote:

Does anyone know how I can check if two lines are parallel in MapBasic? I can't find a function that provides this information so I presume I'm going to have to code a function to perform the check. Any ideas what this function may look like? I'm presuming I'm going to need to compare the angle and direction of the two lines, is this so

The spherical case is a little more interesting, but in the cartesian case if two lines have the same slope, they are parallel. That is, if your first line has coordinates x1,y1 and x2, y2 and your second's are x3,y3 and x4,y4, then (y2-y1)/(x2-x1) = (y4-y3)/(x4-x3). Also, you should first check to make sure that (x2-x1) <> 0 and that (x4-x3) <> 0.
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to