Drag around dots! Test the intersection of the line segments, AB and CD. |AB x AC|*|AB x AD|<0 and |CD x CA|*|CD x CB|<0 (x for outer product, * for multiplication)
This method avoids the illegal math, division by zero(x1=x2 or x3=x4 case). The original project was made by @moonhayul https://scratch.mit.edu/projects/765609110/editor/ #math #line #segment #intersection #condition #collision