Orientation Tests and Floating-Point Filters
Use the sign of a two-dimensional determinant as a geometric predicate and fall back to stronger arithmetic near zero.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Orientation identifies which side of a directed line contains a point
For points \(a,b,c\), use the determinant of vectors \(b-a,c-a\). A positive sign means a counterclockwise turn for standard Cartesian axes. For \(a=(0,0),b=(2,1),c=(1,2)\), the determinant is \(2\cdot2-1\cdot1=3\). Collinear points give zero. The sign scales by the square of a common positive coordinate scaling.
A certified fast path needs an error bound
Compute an approximate determinant and a rigorous bound on the arithmetic error under stated representation assumptions. If the magnitude exceeds that bound, the sign is certified. Otherwise use an adaptive or exact evaluation to resolve the stored input. A fixed tolerance is a different question and can change its answer under rescaling. Segment intersection uses several orientation decisions, and advanced computational geometry follows their role in larger arrangement algorithms.[1]