Hi,

I found that stuff in the FAQ :

----------------------------------------------------------------------

Subject 1.02: How do I find the distance from a point to a line?

Let the point be C (XC,YC) and the line be AB (XA,YA) to (XB,YB).

The length of the line segment AB is L:

L=((XB-XA)**2+(YB-YA)**2)**0.5

and

(YA-YC)(YA-YB)-(XA-XC)(XB-XA)

r = -----------------------------

L**2

(YA-YC)(XB-XA)-(XA-XC)(YB-YA)

s = -----------------------------

L**2

Let I be the point of perpendicular projection of C onto AB, the

XI=XA+r(XB-XA)

YI=YA+r(YB-YA)

Distance from A to I = r*L

Distance from C to I = s*L

[..]

----------------------------------------------------------------------

The computation of s is unclear for me, although it provides the

implicit value of the distance from C to I (I mean without computing I,

then the distance from C to I). And how do you compute s in 3D ?

Thanks.

--