Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have nearly parallel several $3D$ line segments. Some line segments are located (blue line) beside to a specific line segment (black line) and some others (red line) located away from that line segment.

I want to know which line is away and which is beside. I hope to do it by projecting all the line segments to that specific line segment (black line) and.. (however, I do not have a clear idea of how to do this... ). Also I am thinking to use the midpoints of red, blue lines and then project those points onto the black line and test whether it is within the ends.

Also, I am thinking of testing perpendicular distance between lines, but it doesn't give the correct answer. I guess as we do not know small distances are always given by away lines or vice-versa. However, I am looking for an easily implementable method. Any help please.

enter image description here

I also inserted an image to make it clear to you. Thank you in advance.

share|improve this question

put on hold as unclear what you're asking by Ivo Terek, Mike Miller, Clayton, amWhy, k170 yesterday

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Your problem seems subjective to me. If you project the red and blue lines onto the black line, you will see that the red line and the black line partially overlap; and likewise, the blue line and the black line partially overlap. If you look at perpendicular distances, the red line is closer to the black line than the blue line is. So it's not clear exactly what "beside" and "away" mean. My best guess is that two line segments are "beside" each other if and only if they are parallel edges of some rectangle; is this correct? –  Tanner Swett Mar 23 '12 at 16:17
    
By the way, if your question still makes sense in two dimensions, it is probably a good idea to make a diagram of the two-dimensional case, since the three-dimensional case may be very hard to make a good diagram out of. –  Tanner Swett Mar 23 '12 at 16:21
    
@Tanner L. Swett: ok, lets say my blue line is fully overlap and red is not. if i get the mid point of red and blue lines and then project it on to the black line, i guess i can solve this.Is it? i would like to stick to something like projection instead rectangle as i have the projection functions... any solution now plz. –  niro Mar 25 '12 at 23:00