home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
gdead.berkeley.edu
/
gdead.berkeley.edu.tar
/
gdead.berkeley.edu
/
pub
/
cad-tools
/
ciftomann.tar
/
Lib
/
intersection.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-01-28
|
909b
|
50 lines
#include "ciftomann.h"
#include "aeledge.h"
#include "intersection.h"
/* determine which one of the 13 possible ways that two edges can
* relate to each other
*/
Intersection(A,M)
AEL_EDGEPTR A,M;
{
if (A->x == M->x) {
if (A->xend == M->xend)
return(COINCIDENT);
else if (A->xend > M->xend)
return(A_LCOVERS_M);
else
return(M_LCOVERS_A);
}
else if (A->x > M->x) {
if (M->xend == A->x)
return(LPOINT);
else if (M->xend < A->x)
return(LDISJOINT);
else {
if (A->xend == M->xend)
return(M_RCOVERS_A);
else if (A->xend > M->xend)
return(LOVERLAP);
else
return(M_COVERS_A);
}
}
else {
if (A->xend == M->x)
return(RPOINT);
else if (A->xend < M->x)
return(RDISJOINT);
else {
if (A->xend == M->xend)
return(A_RCOVERS_M);
else if (A->xend > M->xend)
return(A_COVERS_M);
else
return(ROVERLAP);
}
}
}