Definition · Proper crossing, touching, and meetingSegments p₁p₂ and q₁q₂ cross properly when orient(q₁, q₂, p₁) and orient(q₁, q₂, p₂) are nonzero with opposite signs and orient(p₁, p₂, q₁) and orient(p₁, p₂, q₂) are too. They touch when an endpoint of one lies on the other segment. They meet when they share at least one point, which is exactly when they cross properly or touch.
Theorem · The four signs are sufficient when none of them is zeroIf all four orientation determinants are nonzero, then the segments meet if and only if they cross properly.
Suppose they cross properly. Then p₁ and p₂ are strictly on opposite sides of the line through q₁q₂, so the segment p₁p₂ meets that line at a single interior point x. Symmetrically the segment q₁q₂ meets the line through p₁p₂ at a single interior point y. Both x and y lie on both lines, and two distinct lines meet in at most one point — they are distinct because all four determinants are nonzero — so x = y, and that point is interior to both segments.
Conversely, suppose they meet at some point z and that no determinant is zero. Then no endpoint of either lies on the other's line, so z is interior to both segments; hence each segment has points strictly on both sides of the other's line, and since its endpoints are not on that line they must be on opposite sides. That is a proper crossing.
□
The hypothesis is doing all the work, and it is the hypothesis that almost never holds on real data. Rectilinear layouts, lattice coordinates, anything snapped to a grid, anything sharing endpoints: all of them produce zeros. An implementation that ships the proper test alone is correct on general position and wrong on the inputs people actually have.
Example · The crossing everybody drawsTake p₁p₂ from (0, 0) to (6, 6) and q₁q₂ from (0, 6) to (6, 0). The four determinants are −36, 36, 36, −36, so the signs are −1, 1, 1, −1: opposite in each pair, none of them zero. The proper test says yes, the parametric solve says yes, and the bounding boxes overlap. Everything agrees, which is what makes this the wrong example to test an implementation on.
The magnitude 36 is the same for all four here because the configuration is symmetric, and it is worth remembering from “The Orientation Test” what those numbers mean: |orient(q₁, q₂, p₁)| = 36 says the triangle q₁ q₂ p₁ has area 18. The test discards every bit of that and keeps four signs.
The box filter is a filter
Two segments whose bounding boxes do not overlap cannot meet, and that test is four comparisons with no multiplication in it. It is worth doing first, and it is never an answer: boxes that overlap say nothing at all. The lab prints the box verdict as its own row so that the distinction between a filter and a decision is on the page. None of the seven worked examples happens to have overlapping boxes and segments that miss, so type 0, 0; 4, 4; 2, 0; 4, 1 to see one: the boxes overlap, the four signs are 1, 1, −1, −1, and the segments do not meet.
The parametric route, and why it is the check
Write a point of the first segment as p₁ + t(p₂ − p₁) and of the second as q₁ + u(q₂ − q₁). Setting them equal gives two linear equations in t and u, whose determinant is the cross product of the two direction vectors. When that is nonzero, t and u are ratios of determinants and the segments meet exactly when both lie in [0, 1]. Force the denominator positive by negating both numerators if necessary, and the test becomes four integer comparisons with no division.
When the denominator IS zero the directions are parallel, and there are two sub-cases: not collinear, where they cannot meet at all; and collinear, where the question becomes whether two intervals on a line overlap. The oracle handles that by projecting onto the first segment's direction with a dot product, which is a different computation from anything the four-sign test does. That is what makes it a check rather than a restatement, and the page reports a disagreement in red and declines to say which route is right.