In Java, how to decide if a point is on the boundary of a GeneralPath?
<p>I find out that the <code>GeneralPath</code> class in Java only provides methods to check if a point is inside a general path (to be specific, <strong>a polygon with straight line segments</strong>). Does someone know how to <em><strong>efficiently</strong></em> check if a point is on the boundary of a general path or not?</p>

<p>Thanks</p>

<p><strong>Dummy solution 1:</strong> We can define a circle with radius $\epsilon$ ($\epsilon$ is a very small positive real value). And then, we check a sufficient number of points on the circle to see if one/some of them falls into the general path or not. However, such a dummy method may require a considerable amount of computational effort, which is not very desirable.</p>

<p><strong>Dummy solution 2:</strong> We can compute the distances from the point (on the boundary) to every side of the polygon. If the minimal distance is sufficiently small, this point is on the boundary; otherwise, it is not. Again, this method can still be computationally intensive.</p>
