📚 The Shortest Distance from a Line to a Point | 点到直线的最短距离
In coordinate geometry and vector analysis, one of the fundamental problems is finding the perpendicular distance from a given point to a given straight line. This distance is the shortest possible length between the point and any point on the line, and it plays a crucial role in optimisation, physics, and 3D modelling. In IB Mathematics, both the two‑dimensional and three‑dimensional cases are examined, often requiring a solid understanding of vectors, dot products, and projection.
在坐标几何和向量分析中,一个基本问题是求已知点到已知直线的垂直距离。这个距离是点与直线上任意一点之间可能的最短长度,在优化、物理和三维建模中起着关键作用。在IB数学中,二维和三维的情形都会考查,通常需要扎实掌握向量、点积和投影的概念。
1. Understanding the Problem | 理解问题
The shortest distance from a point to a line is always measured along the perpendicular from the point to the line. If we drop a perpendicular from the point onto the line, the foot of the perpendicular gives the closest point on the line. The length of this perpendicular segment is the required distance. In vector terms, we can think of this as the magnitude of the component of a position vector that is orthogonal to the direction of the line.
从点到直线的最短距离总是沿着从该点到直线的垂线来测量。如果我们从点向直线作垂线,垂足就是直线上最近的点。这条垂线段的长度就是所求的距离。用向量的语言来说,我们可以将其视为位置向量在正交于直线方向上的分量的大小。
2. Vector Approach in 2D | 二维向量方法
Consider a line passing through point A with direction vector d, and an external point P. The shortest distance from P to the line is given by the length of the perpendicular from P to the line. Vector AP = p – a. The distance d can be calculated using the formula:
考虑一条经过点A且方向向量为 d 的直线,以及外部一点P。从P到直线的最短距离等于从P到直线的垂线长度。向量 AP = p – a。距离d可以用以下公式计算:
d = |(p – a) × d| / |d|
the magnitude of the determinant). Alternatively, using the dot product, we first find the projection of AP onto d, then use Pythagoras. Both methods yield the same result.
其中 × 表示二维叉积(行列式的大小)。或者,使用点积,我们先求出 AP 在 d 上的投影,再利用勾股定理。两种方法得出相同的结果。
3. Vector Approach in 3D | 三维向量方法
In three dimensions, the cross product becomes essential because we can no longer rely on a simple perpendicular slope. For a line passing through A with direction vector d, and an external point P, the shortest distance is:
在三维空间中,叉积变得至关重要,因为我们不能再依赖简单的垂直斜率了。对于一条经过A且方向向量为 d 的直线,以及外部一点P,最短距离为:
d = |(p – a) × d| / |d|
This formula works because the magnitude of the cross product |AP × d| represents the area of the parallelogram formed by AP and d. Dividing by the base length |d| gives the height, which is exactly the perpendicular distance.
这个公式行之有效,因为叉积的大小 |AP × d| 表示由 AP 和 d 构成的平行四边形的面积。除以底边长度 |d| 就得到高,恰好就是垂直距离。
4. Derivation using Projection | 利用投影推导
Another way to understand the formula is through scalar projection. The vector AP can be decomposed into two components: one parallel to d, and one perpendicular to d. The parallel component has length |AP · d| / |d|. By Pythagoras’ theorem, the perpendicular component (the required distance) is √(|AP|² – (parallel component)²). This method is particularly useful when you only have access to the dot product.
另一种理解公式的方法是通过标量投影。向量 AP 可以分解为两个分量:一个平行于 d,另一个垂直于 d。平行分量的长度为 |AP · d| / |d|。根据勾股定理,垂直分量(即所求距离)为 √(|AP|² – (平行分量)²)。当你只能使用点积时,这种方法尤其有用。
5. Formula in Coordinate Geometry (2D) | 坐标几何中的公式(二维)
For a line given in the general form ax + by + c = 0 and a point (x₁, y₁), the perpendicular distance is given by the well‑known formula:
对于一般式 ax + by + c = 0 给出的直线和点 (x₁, y₁),垂直距离由著名的公式给出:
d = |ax₁ + by₁ + c| / √a² + b²
This can be derived from the vector approach by noting that (a, b) is a normal vector to the line. The expression ax₁ + by₁ + c is proportional to the scalar projection onto the normal, and dividing by the length of the normal gives the distance.
这可以从向量方法推导出来,只需注意到 (a, b) 是直线的法向量。表达式 ax₁ + by₁ + c 与在法向量上的标量投影成正比,除以法向量的长度就得到距离。
6. Worked Example – 2D Vector Method | 例题 – 二维向量方法
Find the shortest distance from the point P(5, 2) to the line passing through A(1, 1) with direction vector d = (3, 4).
求点 P(5, 2) 到经过 A(1, 1) 且方向向量为 d = (3, 4) 的直线的最短距离。
First, AP = (5–1, 2–1) = (4, 1). The 2D cross product magnitude is |4×4 – 1×3| = |16 – 3| = 13. |d| = √3²+4² = 5. Therefore, d = 13/5 = 2.6.
首先,AP = (5–1, 2–1) = (4, 1)。二维叉积的大小为 |4×4 – 1×3| = |16 – 3| = 13。|d| = √3²+4² = 5。因此,d = 13/5 = 2.6。
7. Worked Example – 3D Vector Method | 例题 – 三维向量方法
Find the distance from P(2, –1, 3) to the line through A(1, 0, –1) with direction d = (1, 2, 2).
求点 P(2, –1, 3) 到经过 A(1, 0, –1) 且方向为 d = (1, 2, 2) 的直线的距离。
AP = (1, –1, 4). Compute cross product AP × d:
i( (–1)×2 – 4×2 ) – j( 1×2 – 4×1 ) + k( 1×2 – (–1)×1 )
= i(–2 – 8) – j(2 – 4) + k(2 + 1) = (–10, 2, 3).
Magnitude = √100 + 4 + 9 = √113.
|d| = √1+4+4 = 3.
Distance = √113 / 3 ≈ 3.54.
AP = (1, –1, 4)。计算叉积 AP × d:
i( (–1)×2 – 4×2 ) – j( 1×2 – 4×1 ) + k( 1×2 – (–1)×1 )
= i(–2 – 8) – j(2 – 4) + k(2 + 1) = (–10, 2, 3)。
大小 = √100 + 4 + 9 = √113。
|d| = √1+4+4 = 3。
距离 = √113 / 3 ≈ 3.54。
8. Using the 2D Coordinate Formula | 使用二维坐标公式
Find the distance from (3, –2) to the line 4x – 3y + 5 = 0.
求点 (3, –2) 到直线 4x – 3y + 5 = 0 的距离。
Substitute into d = |4·3 – 3·(–2) + 5| / √(4²+(–3)²) = |12 + 6 + 5| / 5 = 23/5 = 4.6.
代入 d = |4·3 – 3·(–2) + 5| / √(4²+(–3)²) = |12 + 6 + 5| / 5 = 23/5 = 4.6。
9. Special Cases and Common Mistakes | 特殊情况与常见错误
If the point lies on the line, the distance is zero. This is consistent with both formulas. A common mistake is forgetting the absolute value in the coordinate formula, which would give a signed distance. In vector problems, students sometimes use the wrong vector order or forget to divide by |d|. Always ensure you take the magnitude of the cross product. When the line is vertical or horizontal, the problem simplifies, but the general formulas still apply.
如果点位于直线上,距离为零。这与两个公式都一致。一个常见错误是忘记坐标公式中的绝对值,那会给出带符号的距离。在向量问题中,学生有时会弄错向量顺序,或忘记除以 |d|。务必确保取叉积的大小。当直线为竖直或水平时,问题会简化,但一般公式仍然适用。
10. Applications and Summary | 应用与总结
The concept of the shortest distance from a point to a line is widely used in physics (e.g., moment of a force about a point), computer graphics (collision detection), and engineering. Mastering both the vector and coordinate methods gives you flexibility. In summary, the key formula is d = |AP × d| / |d| in 2D and 3D, while in coordinate geometry d = |ax₁+by₁+c| / √a²+b². Always remember that the shortest path is perpendicular to the line.
点到直线的最短距离概念被广泛应用于物理学(例如力对点的力矩)、计算机图形学(碰撞检测)和工程学中。熟练掌握向量和坐标方法能让你游刃有余。总之,二维和三维中关键的公式是 d = |AP × d| / |d|,而在坐标几何中是 d = |ax₁+by₁+c| / √a²+b²。永远记住,最短路径垂直于直线。
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图