A ball with position and velocity $(P_0,V_0)$ is in a triangle. Which side of the triangle it will hit?
Calculations: The ball's motion is
$$L( t) = P_0+t*V_0 = \ ( V_{0_{x}} t+P_{0_{x}} ,V_{0_{y}} t+P_{0_{y}}) \tag{1}$$
The sides of the triangle are given by $A_1x+B_1y=C_1$, and we can represent the other two sides similarly. Substituting for $x$ and $y$ in $(1)$, we have:
$$A_1x+B_1y=C_1 \rightarrow A_{1}( V_{0_{x}} t_1+P_{0_{x}}) +B_{1}( V_{0_{y}} t_1+P_{0_{y}}) =C_{1} \tag{5}$$ $$t_{1} =\frac{C_{1} -A_{1} P_{0_{x}} +B_{1} P_{0_{y}}}{A_{1} V_{0_{x}} +B_{1} V_{0_{y}}} \tag{6}$$
Problem: When I compute my solution in Desmos, my formulas produce the wrong minimum time. For instance, even though the ball would clearly hit the Wall 2 (Blue), the minimum time is $t_3$! I've tried many things, but to no avail. Any help is greatly appreciated.
Link to Desmos Computation: Here

Two things: One, the $+$ in the numerator of (6) seems like it should be $-$ (or, alternatively, you left out a pair of parentheses in the numerator). But also, you calculated the minimum $t$-values for reaching a side, whether that time represented the future (positive) or past (negative). If the ball only moves forward in time, you want the minimum non-negative time among the solutions for hitting each side of the triangle.