If the ends of a beam are defined by X1,Y1,Z1 and X2,Y2,Z2, and the point is Xp,Yp,Zp then
- Find the set of beams for which Xp is within the range X1 to X2.
- From that set find the set for which Yp is within the range Y1 to Y2.
- From that set find the set for which Zp is within the range Z1 to Z2.
Find the beam from that set for which the angle (X1,Y1,Z1)(Xp,Yp,Zp)(X2,Y2,Z2) is equal to 180 degrees, within a suitable tolerance.
That's the beam you want.
Doug Jenkins
Interactive Design Services