Finds the shortest distance between two segments.
This function is changed so it is not doing any comparison of distance but just sending every possible combination further to lw_dist2d_pt_seg
Definition at line 1821 of file measures.c.
1823 double s_top, s_bot,
s;
1824 double r_top, r_bot,
r;
1826 LWDEBUGF(2,
"lw_dist2d_seg_seg [%g,%g]->[%g,%g] by [%g,%g]->[%g,%g]",
1827 A->
x,A->
y,B->
x,B->
y, C->
x,C->
y, D->
x, D->
y);
1830 if ( ( A->
x == B->
x) && (A->
y == B->
y) )
1836 if ( ( C->
x == D->
x) && (C->
y == D->
y) )
1863 r_top = (A->
y-C->
y)*(D->
x-C->
x) - (A->
x-C->
x)*(D->
y-C->
y);
1864 r_bot = (B->
x-A->
x)*(D->
y-C->
y) - (B->
y-A->
y)*(D->
x-C->
x);
1866 s_top = (A->
y-C->
y)*(B->
x-A->
x) - (A->
x-C->
x)*(B->
y-A->
y);
1867 s_bot = (B->
x-A->
x)*(D->
y-C->
y) - (B->
y-A->
y)*(D->
x-C->
x);
1869 if ( (r_bot==0) || (s_bot == 0) )
1903 if (((A->
x==C->
x)&&(A->
y==C->
y))||((A->
x==D->
x)&&(A->
y==D->
y)))
1908 else if (((B->
x==C->
x)&&(B->
y==C->
y))||((B->
x==D->
x)&&(B->
y==D->
y)))
1915 theP.
x = A->
x+
r*(B->
x-A->
x);
1916 theP.
y = A->
y+
r*(B->
y-A->
y);
#define LW_TRUE
Return types for functions with status returns.
#define LWDEBUGF(level, msg,...)
int lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl)
lw_dist2d_comp from p to line A->B This one is now sending every occasion to lw_dist2d_pt_pt Before i...
References DIST_MAX, DIST_MIN, DISTPTS::distance, lw_dist2d_pt_seg(), LW_FALSE, LW_TRUE, LWDEBUGF, DISTPTS::mode, DISTPTS::p1, DISTPTS::p2, r, s, DISTPTS::twisted, POINT2D::x, and POINT2D::y.
Referenced by lw_dist2d_arc_arc(), lw_dist2d_ptarray_ptarray(), lw_dist2d_seg_arc(), and rect_leaf_node_distance().