![]() |
Calculating the distance of a point from a line is a fundamental concept in geometry with numerous applications in fields like computer graphics, navigation, and even machine learning. In this article, we have covered, Distance of a Point from a line definition, its formula in 2D and 3D and others in detail. Table of Content What is Distance of a Point From a Line?Distance between a point and a line (in a 2D or 3D space) is the distance of a perpendicular line drawn from a point to the line. This perpendicular distance from a point to a line is also the shortest distance between them. Formula for Distance of a Point From a Line in 2DThe perpendicular distance from a point P(x1, y1) and line A.x + B.y + C = 0 in 2D space is given by,
Where,
Formula for Distance of a Point From a Line in 3DThe perpendicular distance between a point P(x1, y1, z1) and a line with distance vector [Tex]\overrightarrow{\rm v}[/Tex], is given by,
Where,
Perpendicular Distance of a Point From a LineAs defined above, the distance, (shortest distance) of a point from a line, is the length of the perpendicular drawn from the point to the line. Below are the steps to derive the formula for finding the shortest distance between a point and a line. Step 1: Consider a line (L: Ax + By + C = 0) whose distance from the point {P (x1, y1)} is (d). Step 2: Draw a perpendicular (PM) from the point (P) to the line (L) as shown in the figure below. Step 3: Let (Q) and (R) be the points where the line meets the x-axis and y-axis, respectively. Step 4: Coordinates of the points can be written as Q(-C/A, 0) and R(0, -C/B). Now using the formula one can easily found the distance of the point from the line. Derivation of Distance of a Point from a Line in 2DLet’s consider a point P(x1, y1) and a line L: Ax + By + C = 0 passing through and intersecting the x-axis and y-axis at points S and T. Then, the coordinates of S and T are given by S(-C / A, 0) and T (0, -C / B). Also, consider the perpendicular line PM from P to the line segment S and T as d. ![]() Derivation of Distance of a Point from a Line in 2D We know that, Area of Triangle PST = 1/2(PM × ST) 2 × area of triangle PST = PM × ST—- equation(i) Area of triangle PST = (1/2) × ((x1.(0 + (C/B))) + (-C/A)((-C/B) – y1)+ 0(y1 – 0)) = (1/2) × |x1.(C/B) + y1(C/A) + (C2/ AB)| Or, 2 × area of triangle PST = |x1(C/B) + y1(C/A) + (C2/ AB)|—- equation(ii) By Distance formula, ST = ((0 + (C/A))2 + ((C/B) – 0)2)1/2 ST = |C/AB| (A2 + B2)1/2—- equation(iii) By putting the value of equation (ii) and equation (iii) in equation (i), we get, |x1(C/B) + y1(C/A) + (C2/ AB)| = PM × |C/AB| (A2 + B2)1/2 PM = (|C/AB| | A.x1 + B.y1 + C |) / (|C/AB| (A2 + B2)1/2) PM = |A.x1 + B.y1 + C| / (A2 + B2)1/2 Therefore, the shortest perpendicular distance from a point to a line is,
Derivation of Distance of a Point from a Line in 3DLet’s consider a line L in 3D space passing through a point A with direction vector [Tex]\overrightarrow{\rm v}[/Tex]. So, A is any point on the line with distance vector[Tex]\overrightarrow{\rm v}[/Tex]. Let P be any point which is not the line L. ![]() Derivation of Distance of a Point from a Line in 3D In the diagram given above, we have a vector passing through point P which is parallel to the line with distance vector [Tex]\overrightarrow{\rm v}[/Tex] and also, we have a line parallel to line AP with distance vector [Tex]\overrightarrow{\rm AP}[/Tex]. By applying parallelogram law, with the help of given line L with distance vector [Tex]\overrightarrow{\rm v}[/Tex] and line passing through point A and P with distance vector [Tex]\overrightarrow{\rm AP}[/Tex], Now, we find the area of parallelogram in two ways, Way 1 (Finding Area of Parallelogram)By the geometric interpretation of the magnitude of cross product, Area of parallelogram = Magnitude of the cross product between vectors [Tex]\overrightarrow{\rm v}[/Tex] and [Tex]\overrightarrow{\rm AP}[/Tex] ⇒ Area of Parallelogram = | [Tex]\overrightarrow{\rm AP}[/Tex] × [Tex]\overrightarrow{\rm v}[/Tex]|—–> equation(i) Way 2 (Finding Area of Parallelogram)We can also find area of parallelogram by multiplying base of the parallelogram with its altitude or height, Area of Parallelogram = Magnitude of vector [Tex]\overrightarrow{\rm v}[/Tex] × D ⇒ Area of Parallelogram = |[Tex]\overrightarrow{\rm v}[/Tex]| × D—–> equation(ii) From equations, (i) and (ii), we get, |[Tex]\overrightarrow{\rm v}[/Tex]| × D = | [Tex]\overrightarrow{\rm AP}[/Tex] × [Tex]\overrightarrow{\rm v}[/Tex]| D = |[Tex] \overrightarrow{\rm AP}[/Tex] × [Tex]\overrightarrow{\rm v}[/Tex] | / | [Tex]\overrightarrow{\rm v}[/Tex]| Therefore the shortest perpendicular distance, D from point P(x1, y1, z1) to a line L, is given by,
ConclusionCalculating the distance of a point from a line might seem complex initially, but with the formula and step-by-step method explained here, it becomes a straightforward task. This fundamental geometric concept is not only important for academic purposes but also has significant real-world applications, making it a valuable tool in your mathematical toolkit. Examples on Distance of a Point From a LineExample 1: Find the distance of point(2, -4) from the line 2x – 6y – 24 = 0 Solution:
Example 2: Find the distance between line 3x – 4y + 10 = 0 and point (-2, 6) Solution:
Example 3: Find the shortest distance from point(3 , 4) to 2x + 3y – 5 = 0 Solution:
Example 4: Find the distance from the point(6, 6) passing through points(3, 0) and (0, 4). Solution:
Example 5: Find the perpendicular distance from point(5, 6) to the line x = -3. Solution:
Example 6: Find the distance between the point P(0, 3, 6) and the line with parameters equations x = 1 – t, y = 1 + 2t, z = 5 + 3t. Solution:
Problem 7: Let L be a line passing through point A(6, 4, 4) in direction vector(1, 3, -10). Find the distance from point P(1, 5, 5) to the line L. Solution 7:
FAQs on Distance of a Point From a LineHow to Find Distance from a Point to Line in 2D?
What are Real-World Applications of Finding the Shortest Distance from a Point to Line?
What does Distance Formula From a Point to a Line Measure?
Can we Extend Distance Formula from a Point to a line in 3D space?
What happens to Distance between a Point and a Line when the Point lies on the Same Line?
Is it Possible that the Distance between a line and a point 3D space be zero?
|
Reffered: https://www.geeksforgeeks.org
Mathematics |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 18 |