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 1026 of file measures3d.c.
1031 if ((A->
x == B->
x) && (A->
y == B->
y) && (A->
z == B->
z))
1036 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)) /
1037 ((B->
x - A->
x) * (B->
x - A->
x) + (B->
y - A->
y) * (B->
y - A->
y) + (B->
z - A->
z) * (B->
z - A->
z));
1058 c.
x = A->
x +
r * (B->
x - A->
x);
1059 c.
y = A->
y +
r * (B->
y - A->
y);
1060 c.
z = A->
z +
r * (B->
z - A->
z);
int lw_dist3d_pt_pt(const POINT3DZ *thep1, const 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().