2D polygon interior detection
by Bruno Luong
06 Jun 2010
(Updated 07 Jun 2010)
Detect a whereas a point is interior or exterior to a 2D polygon
|
Watch this File
|
| File Information |
| Description |
This function tries to improve the slow Matlab INPOLYGON function.
There are few other fast codes on FEX (e.g., by Darren Engwirda). After exploring many different ways, I come to the conclusion that Darren Engwirda's approach is close to optimal. So here you'll find a general method that share many common aspects, but implemented in C-Mex. I have makes few contributions: (1) a lean C-implementation, (2) Using Matlab SORT and HISTC for binning, (3) Derive an empirical rule when to apply the sorting, (4) a more rigorous on-boundary detection. |
| MATLAB release |
MATLAB 7.10 (2010a)
|
| Other requirements |
Mex setup |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 07 Jun 2010 |
Change the criteria to trigger the presorting step |
|
Contact us at files@mathworks.com