计算几何01-c

2023-07-28 15:39:13 浏览数 (1)

代码语言:javascript复制
markEE( Point S[], int n ) //n > 2
for ( int k = 0; k < n; k   )
S[k].extreme = FALSE;
for ( int p = 0; p < n; p   ) //test
for ( int q = p   1; q < n; q   ) //each
checkEdge( S, n, p, q ); //directed edge pq
代码语言:javascript复制
checkEdge( Point S[], int n, int p, int q )
bool LEmpty = TRUE, REmpty = TRUE;
for ( int k = 0; k < n && ( LEmpty || REmpty ); k  )
if ( (k != p) && (k != q) )
ToLeft( S[p], S[q], S[k] ) ?
LEmpty = FALSE :
REmpty = FALSE ;
if ( LEmpty || REmpty )
S[p].extreme = S[q].extreme = TRUE;

0 人点赞