This problem is called the *point-in-polygon* problem in the graphics and computational geometry literature, and searching that phrase will bring you to much discussion and working code. It is rather firmly established that the best method is the ray-shooting algorithm, described, e.g., in [Wikipedia here][1]. <br /> ![Wikipedia image][2]<br /> Straightforward implementation runs in $O(n)$ time, and you can find this all over the web, including [my own implementation here][3]. If you are going to repeatedly query, sophisticated data structures will allow $O(\log n)$ per query. [1]: http://en.wikipedia.org/wiki/Point_in_polygon#Ray_casting_algorithm [2]: https://i.sstatic.net/VL53Y.png [3]: http://cs.smith.edu/~orourke/books/ftp.html