Fast Inpolygon in MEX

버전 1.2.0.0 (5.86 KB) 작성자: Tolga Birdal
Fast inpolygon function implemented in MEX. So far one of the fastest.
다운로드 수: 1.1K
업데이트 날짜: 2011/3/22

라이선스 보기

This is a C implementation of the great Matlab code provided by Darren Engwirda. You can find his code in:
http://www.mathworks.com/matlabcentral/fileexchange/10391-fast-points-in-polygon-test

According to my estimates, it works more than 2x as fast. So far, this is one of the fastest implementation that I know of. Sorting is big step of this algorithm. To make it an exact replica, I use stable_sort of std library.

Here is a sample call:

tic(); [In2 On2]=inpolygon_fast(x, y, xv, yv); toc();

The call interface is similiar to inpolygon and not to inpoly. Here x and y are the points to check, where xv and yv define the polygon.

The attachment includes the cpp file, a sample function for comparison and Darren's code.

인용 양식

Tolga Birdal (2025). Fast Inpolygon in MEX (https://kr.mathworks.com/matlabcentral/fileexchange/30819-fast-inpolygon-in-mex), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

도움 받은 파일: INPOLY: A fast points-in-polygon test

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.3.0.0

n/a

1.2.0.0

Small updates in description.

1.0.0.0