If there is a collision, uA and uB should both be in the range of 0-1.

PHOTO EMBED

Thu Sep 15 2022 23:38:51 GMT+0000 (Coordinated Universal Time)

Saved by @abell_ds #java

if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
    return true;
}
return false;
content_copyCOPY

Simple!

http://jeffreythompson.org/collision-detection/line-line.php