I have 4 lines segment, A, B, C and D. Each line is represented as two points. Eg. line A is represented as point A1 and point A2.
What I want is 1. point X, which is the point where line A ray intersect with line B 2. distance between X and A1 or A2(either one is fine).
When testing for intersection, line A ray should not 1. intersect with line segment D 2. intersect with line segment C
How do I do this?