Exercise 3: Why Both the Stable Formula and the Tolerance Fix Are Needed — Possible Solution ==================================================================== WHAT EACH FIX ADDRESSES SEPARATELY ------------------------------ Step 8 covers two genuinely different parts of the picking system, each with its own independent failure mode. The ray-sphere test determines WHERE on the chest's surface a click's ray actually hits, and this chapter verified the naive quadratic formula produces a relative error of approximately 3.38*10^-7 in that hit point, versus approximately 1.14*10^-16 for the stable formula - a real, if usually small, positional inaccuracy in the reported hit location. The tooltip boundary check determines whether a click point falls INSIDE a completely separate 2D region (the tooltip box), and this chapter verified that using strict inequality instead of a small tolerance there causes clicks landing very close to (or precisely on) the tooltip's edge to be inconsistently classified as inside or outside, purely due to floating-point rounding in how the click coordinates were computed. WHY FIXING ONLY ONE STILL LEAVES A REAL BUG ------------------------------ These two calculations are independent of each other - the ray-sphere test doesn't affect whether the tooltip check works correctly, and vice versa. Fixing only the ray-sphere formula (switching to the stable version) would make the reported hit point on the chest more accurate, but would do absolutely nothing about a player experiencing inconsistent, flickery tooltip behavior when clicking near its edge - that bug lives entirely in the separate boundary-check code and has its own separate cause (strict equality against floating-point coordinates). Conversely, fixing only the tooltip's boundary tolerance would make tooltip clicks reliable, but would leave the chest's own pick-point accuracy silently degraded by the unstable quadratic formula, which could manifest as (for example) a picked point slightly off the chest's actual surface, most noticeably for grazing click angles, exactly as this course's earlier chapter explained. WHY THIS MATTERS FOR HOW THE FIX SHOULD BE PLANNED ------------------------------ Because the two problems are genuinely unrelated failures in different parts of the same picking system, a developer investigating "picking feels unreliable" needs to recognize these as two separate bugs requiring two separate fixes, rather than assuming a single root cause and a single patch would resolve all of the reported picking problems. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation identifies the two fixes as addressing genuinely independent parts of the picking system (3D hit-point accuracy vs. 2D boundary classification), explains what user-visible symptom would persist if either fix were skipped, and concludes with the practical implication that both must be applied together rather than treating either alone as sufficient.