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 770 of file measures3d.c.
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().
775 if ( ( A->
x == B->
x) && (A->
y == B->
y) && (A->
z == B->
z) )
781 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) )/( (B->
x-A->
x)*(B->
x-A->
x) +(B->
y-A->
y)*(B->
y-A->
y)+(B->
z-A->
z)*(B->
z-A->
z) );
810 c.
x=A->
x + r * (B->
x-A->
x);
811 c.
y=A->
y + r * (B->
y-A->
y);
812 c.
z=A->
z + r * (B->
z-A->
z);
int lw_dist3d_pt_pt(POINT3DZ *thep1, POINT3DZ *thep2, DISTPTS3D *dl)
Compares incomming points and stores the points closest to each other or most far away from each othe...