is this right equation to find wether 2 line segments intersect where
ab and cd are the segments

r=((ay-cy)(dx-cx)-)ax-cx)(dy-cy))/((ay-cy)(bx-ax)-(ax-cx)(by-ay))

s=((ay-cy)(bx-ax)-(ax-cx)(by-ay))/((bx-ax)(dy-cy)-(by-ay)(dx-cx))

and they intersect where r and s are >=0 and <=1

thanxs