s_polygonAxisPairs
global · cmath
- Address
0xcf5c7c· 24 bytes, up to0xcf5c93- Type
uint32_t[6]- Meaning
- Holds the two kept axes of each dropped axis for the polygon test, set by 0x7c18d0
- Confidence
- verified, proof two
- Finding
- cmath/geometry#point-in-polygon
Finding: Point in polygon in cmath: intersections
0x7c23e0(n, axis) tests the point in ecx against n vertices (flat floats, stride 12, in edx)
by the crossing count after dropping coordinate axis: the two kept coordinates are A = tab[axis].a
and B = tab[axis].b from the table 0xcf5c7c, set by the initializer 0x7c18d0 to (2, 1) for axis 0,
(0, 2) for axis 1 and (1, 0) for axis 2. For each edge from the previous vertex (the last for the first)
to the current, with side(V) = V.A ≥ Q.A (false for NaN): a change of side compares
(Vprev.B − Vcur.B)·(Vcur.A − Q.A) with (Vcur.B − Q.B)·(Vprev.A − Vcur.A), and the accumulator toggles when
term2 ≤ term1 equals the current side. n of 0 gives 0.
The derivation is in the doc.