Skip to content

Line–line intersection

In Euclidean geometry, the intersection of a line and a line can be the empty set, a point, or a line. Distinguishing these cases and finding the intersection point have use, for example, in computer graphics, motion planning, and collision detection.

In three-dimensional Euclidean geometry, if two lines are not in the same plane they are called skew lines and have no point of intersection. If they are in the same plane there are three possibilities: if they coincide (are not distinct lines) they have an infinitude of points in common (namely all of the points on either of them); if they are distinct but have the same slope they are said to be parallel and have no points in common; otherwise they have a single point of intersection.

The distinguishing features of non-Euclidean geometry are the number and locations of possible intersections between two lines and the number of possible lines with no intersections (parallel lines) with a given line.

General Form 의 두 직선의 교차점

x 항과 y 항으로 보기 좋게 이동한다.

첫 번째 직선:

\(\begin{align} & Ax + By + C = 0 \\ & x = -B/Ay - C/A \tag{1} \\ & y = -A/Bx - C/B \tag{2} \\ \end{align}\)

두 번째 직선:

\(\begin{align} & Dx + Ey + F = 0 \\ & x = -E/Dy - F/D \tag{3} \\ & y = -D/Ex - F/E \tag{4} \\ \end{align}\)

교차점 P의 x 값과 y 값은 두 직선에 대입해도 성립한다.

x 미지수를 제거:

\(\begin{align} & (1) = (3) \\ & -B/Ay - C/A = -E/Dy - F/D \\ & E/Dy - B/Ay = C/A - F/D \\ & (E/D - B/A)y = (C/A - F/D) \\ & y = (C/A - F/D) / (E/D - B/A) \\ \end{align}\)

우항을 단순화 한다:

\({\displaystyle \begin{align} y &= (C/A - F/D) / (E/D - B/A) \\ &= \frac{\frac{C}{A} - \frac{F}{D}}{\frac{E}{D} - \frac{B}{A}} \\ &= \frac{\frac{CD}{AD} - \frac{AF}{AD}}{\frac{AE}{AD} - \frac{BD}{AD}} \\ &= \frac{\frac{CD - AF}{AD}}{\frac{AE - BD}{AD}} \\ &= \frac{CD - AF}{AD} / \frac{AE - BD}{AD} \\ &= \frac{CD - AF}{AD} * \frac{AD}{AE - BD} \\ &= \frac{(CD - AF) * AD}{AD * (AE - BD)} \\ &= \frac{CD - AF}{AE - BD} \\ &= (CD - AF) / (AE - BD) \\ \end{align} }\)

y 미지수를 제거:

\(\begin{align} & (2) = (4) \\ & -(Ax + C) / B = -(Dx + F) / E \\ & Dx/E - Ax/B = C/B - F/E \\ & (D/E - A/B)x = (C/B - F/E) \\ & x = (C/B - F/E) / (D/E - A/B) \\ \end{align}\)

우항을 단순화 한다:

\({\displaystyle \begin{align} x &= (C/B - F/E) / (D/E - A/B) \\ &= \frac{ \frac{C}{B} - \frac{F}{E} }{ \frac{D}{E} - \frac{A}{B} } \\ &= \frac{ \frac{CE}{BE} - \frac{BF}{BE} }{ \frac{BD}{BE} - \frac{AE}{BE} } \\ &= \frac{ \frac{CE - BF}{BE} }{ \frac{BD - AE}{BE} } \\ &= \frac{CE - BF}{BE} / \frac{BD - AE}{BE} \\ &= \frac{CE - BF}{BE} * \frac{BE}{BD - AE} \\ &= \frac{(CE - BF) * BE}{BE * (BD - AE)} \\ &= \frac{CE - BF}{BD - AE} \\ &= (CE - BF) / (BD - AE) \\ \end{align} }\)

그래서 최종 답은:

  • x = (CE - BF) / (BD - AE)
  • y = (CD - AF) / (AE - BD)

또는 x 항을 미리 구했을 경우 다른 식에 대입하여 계산해도 된다.

(4) 항에 적용할 경우 y = -D/E * ((CE - BF) / (BD - AE)) - F/E

이 경우 분모에 해당하는 (BD - AE) 가 0 이 되면 평행 또는 일치가 된다.

See also

Favorite site

References


  1. Geometry_Concepts_-Line_Intersection_and_its_Applications-_topcoder.pdf