例題 1 Example 1:求通過兩點的直線方程 Equation of a line through two points
求通過 (1, 3) 及 (3, 7) 的直線方程。Find the equation of the line through (1, 3) and (3, 7).
m = (7 − 3)/(3 − 1) = 2y − 3 = 2(x − 1)
答案: Answer: 2x − y + 1 = 0。2x − y + 1 = 0.
SketchMath 數學團隊 SketchMath Maths Team | 更新 Updated 2026-10-20
直線方程 Equations of Straight Line 係數學 DSE 必考課題,大家成日聽到嘅 y = mx + c 就係出自於直線方程!通常我哋會利用方程或圖像方式去求證方程嘅解、座標、斜率 slope、截距 intercept、兩條直線嘅相交點,以及佢哋係咪垂直平行等。SketchMath 為大家介紹所有公式定理及應用,並附上相關題目示範!The equation of a straight line describes where a line sits on the plane. The two common forms are the general form Ax + By + C = 0 and the slope-intercept form y = mx + c. In HKDSE you use the equation or the graph to find coordinates, slope, intercepts, the intersection of two lines, and whether two lines are parallel or perpendicular.
原創練習、提示、詳解與免費 PDF / Original exercises, hints, solutions & free PDF →
Ax + By + C = 0:斜率 −A/B,y 截距 −C/BAx + By + C = 0: slope −A/B, y-intercept −C/By = mx + c(m = 斜率,c = y 軸截距)y = mx + c (m = slope, c = y-intercept)y − y₁ = m(x − x₁)m = (y₂ − y₁) / (x₂ − x₁)m₁ = m₂/m₁ × m₂ = −1m₁ = m₂ / m₁ × m₂ = −1|Ax₀ + By₀ + C| / √(A² + B²)直線方程係描述平面上直線位置嘅數學公式。一條直線可以用不同形式的方程表示,但最常用的是一般式和斜截式。
一般式:Ax + By + C = 0
斜截式:y = mx + c
The equation of a straight line is a formula that describes where a line sits on the plane. A line can be written in different forms, but the most common are the general form and the slope-intercept form.
General form: Ax + By + C = 0
Slope-intercept form: y = mx + c
「Ax + By + C = 0」係由三部分組成,當中特點如下:
| 情況 | 方程 | 備註 |
|---|---|---|
| (1) A = 0, B ≠ 0 | y = −C/B | L 是一條水平線,其斜率是 0 |
| (2) A ≠ 0, B = 0 | x = −C/A | L 是一條鉛垂線,其斜率是未定義 |
| (3) A ≠ 0, B ≠ 0, C = 0 | Ax + By = 0 | L 穿過原點 (0, 0) |
把它整理成 y = −(A/B)x − C/B,可見斜率是 −A/B,y 截距是 −C/B。
Ax + By + C = 0 has three parts, and its features are:
| Case | Equation | Note |
|---|---|---|
| (1) A = 0, B ≠ 0 | y = −C/B | L is a horizontal line, slope 0 |
| (2) A ≠ 0, B = 0 | x = −C/A | L is a vertical line, slope undefined |
| (3) A ≠ 0, B ≠ 0, C = 0 | Ax + By = 0 | L passes through the origin (0, 0) |
Rearranging gives y = −(A/B)x − C/B, so the slope is −A/B and the y-intercept is −C/B.
「y = mx + c」
m = 斜率c = y 軸截距y = mx + c
m = slopec = y-intercept只要符合以下三項條件嘅其中一項,就能夠求得直線方程:
y − y₁ = m(x − x₁)m = (y₂ − y₁)/(x₂ − x₁),再用點斜式y = mx + cThe equation of a line can be found as long as one of these three conditions is met:
y − y₁ = m(x − x₁)m = (y₂ − y₁)/(x₂ − x₁), then use point-slope formy = mx + c求直線斜率嘅方法基本上有五個:
m = (y₂ − y₁)/(x₂ − x₁)m = tan θAx + By + C = 0 求斜率:m = −A/Bm₁ = m₂m₁ × m₂ = −1There are basically five ways to find the slope of a line:
m = (y₂ − y₁)/(x₂ − x₁)m = tan θAx + By + C = 0: m = −A/Bm₁ = m₂m₁ × m₂ = −1距離/長度。線段 AB(A(x₁, y₁)、B(x₂, y₂))的長度是 √[(x₂ − x₁)² + (y₂ − y₁)²]。點 (x₀, y₀) 至直線 Ax + By + C = 0 的距離是 |Ax₀ + By₀ + C| / √(A² + B²)。
Distance / length. The length of AB with A(x₁, y₁) and B(x₂, y₂) is √[(x₂ − x₁)² + (y₂ − y₁)²]. The distance from a point (x₀, y₀) to the line Ax + By + C = 0 is |Ax₀ + By₀ + C| / √(A² + B²).
A(x₁, y₁) 與 B(x₂, y₂) 的中點是 ((x₁ + x₂)/2, (y₁ + y₂)/2)。若 P 把 AB 內分成 AP : PB = m : n,則 P = ((n·x₁ + m·x₂)/(m + n), (n·y₁ + m·y₂)/(m + n))。
The mid-point of A(x₁, y₁) and B(x₂, y₂) is ((x₁ + x₂)/2, (y₁ + y₂)/2). If P divides AB internally in the ratio AP : PB = m : n, then P = ((n·x₁ + m·x₂)/(m + n), (n·y₁ + m·y₂)/(m + n)).
平面上兩條直線,不是相交於一點,就是永不相交(平行);如果它們相交成直角,就是垂直。
Two lines on a plane either meet at a point, or never meet (parallel). When they meet at a right angle they are perpendicular.
交點是同時在兩條直線上的點,所以把兩條方程聯立(消元或代入)求解。要判斷三條直線是否共點,先求其中兩條的交點,再檢查該點是否在第三條直線上。
The intersection is the point that lies on both lines, so solve the two equations simultaneously (elimination or substitution). To test whether three lines pass through one point, find where two of them meet and check the third.
兩直線平行,斜率相等:m₁ = m₂。兩直線垂直,則 m₁ × m₂ = −1。對於 A₁x + B₁y + C₁ = 0 及 A₂x + B₂y + C₂ = 0:平行條件是 A₁B₂ = A₂B₁,垂直條件是 A₁A₂ + B₁B₂ = 0。
Parallel lines have equal slopes: m₁ = m₂. Perpendicular lines satisfy m₁ × m₂ = −1. For A₁x + B₁y + C₁ = 0 and A₂x + B₂y + C₂ = 0: parallel when A₁B₂ = A₂B₁, perpendicular when A₁A₂ + B₁B₂ = 0.
求通過 (1, 3) 及 (3, 7) 的直線方程。Find the equation of the line through (1, 3) and (3, 7).
m = (7 − 3)/(3 − 1) = 2y − 3 = 2(x − 1)答案: Answer: 2x − y + 1 = 0。2x − y + 1 = 0.
求 2x − 3y + 12 = 0 的斜率及截距。Find the slope and the intercepts of 2x − 3y + 12 = 0.
= −A/B = 2/3.y = 0:x = −6;令 x = 0:y = 4。Put y = 0: x = −6. Put x = 0: y = 4.答案: Answer: 斜率 2/3,x 截距 −6,y 截距 4。Slope 2/3, x-intercept −6, y-intercept 4.
求 2x + y − 7 = 0 與 x − y − 2 = 0 的交點。Find the point where 2x + y − 7 = 0 and x − y − 2 = 0 meet.
3x − 9 = 0,所以 x = 3。Add the equations: 3x − 9 = 0, so x = 3.x = 3 代入 x − y − 2 = 0:y = 1。Put x = 3 into x − y − 2 = 0: y = 1.答案: Answer: (3, 1)。(3, 1).
求 (1, 2) 至直線 3x + 4y − 5 = 0 的距離。Find the distance from (1, 2) to the line 3x + 4y − 5 = 0.
|3(1) + 4(2) − 5| = 6 and √(3² + 4²) = 5.答案: Answer: 6/5 = 1.2。6/5 = 1.2.
求頂點為 A(1, 1)、B(5, 2)、C(3, 6) 的三角形面積。Find the area of the triangle with vertices A(1, 1), B(5, 2) and C(3, 6).
1(2 − 6) + 5(6 − 1) + 3(1 − 2) = −4 + 25 − 3 = 18= ½ × |18|答案: Answer: 9 平方單位。9 square units.
P 在 AB 上,AP : PB = 1 : 2,其中 A = (2, −1),B = (8, 5)。求 P。P lies on AB with AP : PB = 1 : 2, where A = (2, −1) and B = (8, 5). Find P.
x = (2 × 2 + 1 × 8) / 3 = 4y = (2 × (−1) + 1 × 5) / 3 = 1答案: Answer: P = (4, 1)。P = (4, 1).
x₁ = x₂,直線是鉛垂線:寫 x = x₁,並說明斜率未定義,不要寫 m = ∞。If x₁ = x₂ the line is vertical: write x = x₁ and say the slope is undefined. Do not write m = ∞.溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。How to study: click any question to load it on the coordinate grid and check your steps.
SketchMath 題庫內的 DSE 風格練習,選擇題及長題目均附解答。 DSE-style practice from the SketchMath question bank, with solutions for every MC and long question.