Challenge: Intersection of Lines

Complete the intersection of lines challenge.

We'll cover the following

Intersection of two lines

Write a Java code to check if the two lines AB\overrightarrow AB and CD\overrightarrow CD intersect. Return true if they intersect and false if they don’t.

Check each point of both lines and their respective positions. The A(x1,y1),B(x2,y2),C(x3,y3),A (x_1, y_1), B (x_2, y_2), C (x_3, y_3), and D(x4,y4)D (x_4, y_4) points are shown in the illustration below.

Note: Don’t worry if you need help. You can see the solution by clicking the “Show Solution” button.

Get hands-on with 1400+ tech skills courses.