note
Zaxo
<p>The Wolf Book, pp441-445 has an implementation which is C-like and unreliable for corner cases. The algorithm is the same one you cite: does a ray from the test point cross edges an even or odd number of times? If odd, it's an interior point.</p>
<p>My take on the OO issues you raise derives from the hierarchy of 0- to 1- to 2-dimensional geometry. <i>Interior</i> and <i>exterior</i> are properties of of each particular polygon, so I suppose that $poly->is_interior($point) is natural. A Line <i>has-a</i> pair of Points to define it, so Point methods are available to it. A Polygon <i>has-a</i> list of Points as vertices, or equivalently a list of Lines with common endpoints. Point and Line methods are available to Polygon.</p>
<p>After Compline,<br/>Zaxo</p>
109325
109325