I have nearly parallel several 3D line segments. some line segments locate (blue line) beside to a spefic line segment (black line) and some other (red line) locate 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 to do this... ). Also i am thinking to use mid point of red, blue lines and then to project those points onto the black line and test whether it is within the ends..... also, i am thinking to test perpendicular distance between lines..but it doesnt give correct answere i guess as we do not know small distances are always given by away lines or vise verse. however, I am looking for easily implementable method.! any help please.

Also inserted an image to make clear you. thank you in advance.