I have a master line segment, against which I am comparing 64 other child line segments. I have other criteria and have filtered out most of the child line segments (I have maybe 10 left).
I now need to find the longest child segment on each side of the master line segment. I can't just take the two longest child segments overall, because they might both be on the same side of the master segment.
To further confuse matters, all line segments can have virtually any orientation, including perfectly vertical or horizontal, or anywhere between.
Is there a reliable way to determine which 'side'of the master line segment each child segment is located? I'd especially appreciate answers suggested in the format of an equation that I can convert directly into code.
My first thought was to just add up the x and y coordinates of both endpoints of the child line and compare to the parent line, and determine which is larger... but I can envision situations where those totals for the two lines could be the same... so maybe simple addition isn't the way to go.
Any help is greatly appreciated!