|
|
The algorithm here works pretty much the same as when calculating the distance from a line to a ray. However we have to limit t to the interval [0, 1]. So now we have t = (-d2 * (q1 - p1) + d1 * (q2 - p2)) / (d2 * e1 - d1 * e2) for (d2 * e1 - d1 * e2) != 0 and t in [0, 1].
|
Copyright © by Martin Ecker |