A reliable test for inclusion of a point in a polygon

This paper takes a careful look at a well-known implementation of an algorithm that tests a point in the plane for inclusion in a given polygon. The implementation, coded in C++, appears in Robert Sedgewick's highly regarded book, Algorithms in C++, and has a number of flaws associated with special cases. The paper discusses the problems and a reliable implementation of the algorithm is developed.