|
|
The used algorithm is very similar to the segment-to-segment distance algorithm with the difference that there are not as many regions to examine. The following graph shows the possible regions. Region 0 is where s and t are >= 0 and that is the region where we have to find the minimum distance of the two rays. t | 1 | 0 | --------------- s | 2 | 3 | For parallel rays we must determine if the direction vectors point in the same direction or not. If they point in the same direction the rays must overlap and we can easily determine the minimum distance. If the direction vectors point in opposite directions the rays can either overlap or not. If they don't overlap the minimum distance is the distance between the two starting points of the rays.
|
Copyright © by Martin Ecker |