Two shadows on an axis either overlap by some amount or leave a gap that proves the shapes are apart. Today you measure that overlap, the decision the whole SAT rests on.
Compute how much two intervals overlap, where a non-positive result means a separating gap.
Given two intervals on the same axis, they overlap from the larger of their two
minimums to the smaller of their two maximums; the length of that span is
min(maxes) - max(mins). When that comes out positive the shadows overlap by that
amount. When it comes out zero or negative, there is a gap: the shapes do not touch
along this axis, and that single fact is enough to conclude they do not collide at all.
That is the heart of the Separating Axis Theorem: if you can find even one axis where the projections leave a gap, the shapes are provably separated and you can stop. If every candidate axis shows an overlap, they intersect, and the axis with the smallest overlap is the direction of shallowest penetration - the contact normal. The next lesson runs this over all of two polygons’ edge normals to produce a full manifold.
// positive: overlap amount; zero or negative: a gap of that sizefunc Overlap(a, b Interval) float64 {return math.Min(a.Max, b.Max) - math.Max(a.Min, b.Min)}