If searching for min distance, this one finds the closest point on segment A-B from p.
if searching for max distance it just sends p-A and p-B to pt-pt calculation
Definition at line 992 of file measures3d.c.
997 if ((A->
x == B->
x) && (A->
y == B->
y) && (A->
z == B->
z))
1002 r = ((p->
x - A->
x) * (B->
x - A->
x) + (p->
y - A->
y) * (B->
y - A->
y) + (p->
z - A->
z) * (B->
z - A->
z)) /
1003 ((B->
x - A->
x) * (B->
x - A->
x) + (B->
y - A->
y) * (B->
y - A->
y) + (B->
z - A->
z) * (B->
z - A->
z));
1024 c.
x = A->
x +
r * (B->
x - A->
x);
1025 c.
y = A->
y +
r * (B->
y - A->
y);
1026 c.
z = A->
z +
r * (B->
z - A->
z);
int lw_dist3d_pt_pt(POINT3DZ *thep1, POINT3DZ *thep2, DISTPTS3D *dl)
Compares incoming points and stores the points closest to each other or most far away from each other...
References DIST_MAX, lw_dist3d_pt_pt(), DISTPTS3D::mode, r, POINT3DZ::x, POINT3DZ::y, and POINT3DZ::z.
Referenced by lw_dist3d_pt_ptarray(), and lw_dist3d_seg_seg().