advance Method

Process the current edge ending at (x2,y2).

  • Accumulate left/right parity of the test point wrt to the polygon. These counts track the number of polygon crossings of the left and right horizontal rays emanating from the test point. After all edges are processed, if either count is odd/even, the test point is inside/outside the polygon (see classifyCounts).
  • Check whether the test point lies on the edge.

advance(x2: number, y2: number): boolean

@returns whether caller should continue processing with the next edge. In particular, false if we have an exact hit.

Parameter Type Description
x2 number  
y2 number  

Returns - boolean

whether caller should continue processing with the next edge. In particular, false if we have an exact hit.

Defined in

Last Updated: 14 November, 2024