Рет қаралды 260
In this video, I will show you how to find the intersection of two lines in the plane. I will explain the steps in a clear and concise way, and I will use visual aids to help you understand the concepts. By the end of this video, you will be able to find the intersection of two lines in the plane with ease.
Case 1: slope-intercept form.
y1 = ax + b
y2 = cx + d
x = (d - b) / (a - c)
y = ax + b
P = [x, y]
Case 2: general form.
a1x + b1y + c1 = 0
a2x + b2y + c2 = 0
u1 = (a1, b1, c1)
u2 = (a2, b2, c2)
u1 × u2 = (ap, bp, cp)
u1 × u2 = (b1*c2 - b2*c1, a2*c1 - a1*c2, a1*b2 - a2*b1)
P = [ap/cp, bp/cp]
Case 3: The lines are both defined by two points.
line1: (x1, y1), (x2, y2)
line2: (x3, y3), (x4, y4)
a = (x1*y2 - y1*x2)
b = (x3*y4 - y3*x4)
c = (x1 - x2)*(y3 - y4) - (y1 - y2)*(x3 - x4)
x = (a*(x3 - x4) - (x1 - x2)*b) / c
y = (a*(y3 - y4) - (y1 - y2)*b) / c
P = [x, y]
/ edgardocpu