【直線方程 Equations of Straight Lines:斜率、截距、交點、平行及垂直】Equations of Straight Lines: Slope, Intercept, Intersection, Parallel and Perpendicular

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.

用 AI 逐步解直線方程題目 Solve it with AI練習 100 條 DSE 模擬題 Practise 100 DSE-style questions

原創練習、提示、詳解與免費 PDF / Original exercises, hints, solutions & free PDF →

拖動斜率及截距,看直線移動。 Drag the slope and the intercept and watch the line move. 自己試試 → Try it yourself →

直線方程公式 Straight-line Formulas

一般式General formAx + By + C = 0:斜率 −A/B,y 截距 −C/BAx + By + C = 0: slope −A/B, y-intercept −C/B
斜截式Slope-intercept formy = mx + c(m = 斜率,c = y 軸截距)y = mx + c (m = slope, c = y-intercept)
點斜式Point-slope formy − y₁ = m(x − x₁)
兩點求斜率Slope from two pointsm = (y₂ − y₁) / (x₂ − x₁)
平行/垂直Parallel / perpendicularm₁ = m₂/m₁ × m₂ = −1m₁ = m₂ / m₁ × m₂ = −1
點至直線距離Distance from a point to a line|Ax₀ + By₀ + C| / √(A² + B²)
↑ 返回頁頂 Back to top

直線方程 Equations of Straight Lines

直線方程係描述平面上直線位置嘅數學公式。一條直線可以用不同形式的方程表示,但最常用的是一般式和斜截式。

一般式: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

拖動斜率 m:通過 (1, 2) 的同一條直線,可寫成點斜式、斜截式或一般式。 Drag the slope m: the same line through (1, 2) can be written in point-slope, slope-intercept or general form.
↑ 返回頁頂 Back to top

直線方程一般式特點 Features of the General Form

「Ax + By + C = 0」係由三部分組成,當中特點如下:

情況方程備註
(1) A = 0, B ≠ 0y = −C/BL 是一條水平線,其斜率是 0
(2) A ≠ 0, B = 0x = −C/AL 是一條鉛垂線,其斜率是未定義
(3) A ≠ 0, B ≠ 0, C = 0Ax + By = 0L 穿過原點 (0, 0)

把它整理成 y = −(A/B)x − C/B,可見斜率是 −A/B,y 截距是 −C/B。

Ax + By + C = 0 has three parts, and its features are:

CaseEquationNote
(1) A = 0, B ≠ 0y = −C/BL is a horizontal line, slope 0
(2) A ≠ 0, B = 0x = −C/AL is a vertical line, slope undefined
(3) A ≠ 0, B ≠ 0, C = 0Ax + By = 0L 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.

拖動 3x + By − 6 = 0 中的 B:x 截距保持 2,斜率 −3/B 及 y 截距 6/B 則會改變。 Drag B in 3x + By − 6 = 0: the x-intercept stays at 2, while the slope −3/B and the y-intercept 6/B change.
↑ 返回頁頂 Back to top

直線方程斜截式特點 Features of the Slope-intercept Form

「y = mx + c」

  • m = 斜率
  • c = y 軸截距

y = mx + c

  • m = slope
  • c = y-intercept
↑ 返回頁頂 Back to top

求直線方程的方法 Methods of Finding the Equation of a Straight Line

只要符合以下三項條件嘅其中一項,就能夠求得直線方程:

  1. 直線的斜率 (m) 及該直線上一點的坐標 (x₁, y₁):用 y − y₁ = m(x − x₁)
  2. 直線上任意兩點的坐標 (x₁, y₁) 及 (x₂, y₂):先求 m = (y₂ − y₁)/(x₂ − x₁),再用點斜式
  3. 直線的斜率 (m) 及其 y 軸截距 (c):用 y = mx + c

The equation of a line can be found as long as one of these three conditions is met:

  1. the slope (m) and the coordinates of one point on the line (x₁, y₁): use y − y₁ = m(x − x₁)
  2. the coordinates of any two points on the line (x₁, y₁) and (x₂, y₂): find m = (y₂ − y₁)/(x₂ − x₁), then use point-slope form
  3. the slope (m) and the y-intercept (c): use y = mx + c
↑ 返回頁頂 Back to top

求直線斜率的方法 Methods of Finding the Slope

求直線斜率嘅方法基本上有五個:

  1. 由兩點求斜率:m = (y₂ − y₁)/(x₂ − x₁)
  2. 由傾角 θ 求斜率:m = tan θ
  3. 由一般式 Ax + By + C = 0 求斜率:m = −A/B
  4. 由平行線求斜率:兩直線平行,斜率相等,m₁ = m₂
  5. 由垂直線求斜率:兩直線垂直,m₁ × m₂ = −1

There are basically five ways to find the slope of a line:

  1. From two points: m = (y₂ − y₁)/(x₂ − x₁)
  2. From the angle of inclination θ: m = tan θ
  3. From the general form Ax + By + C = 0: m = −A/B
  4. From a parallel line: parallel lines have the same slope, m₁ = m₂
  5. From a perpendicular line: m₁ × m₂ = −1
轉動直線:斜率是 tan θ,傾角為銳角時為正,鈍角時為負。 Turn the line: the slope is tan θ, positive for an acute angle of inclination and negative for an obtuse one.
↑ 返回頁頂 Back to top

求直線的長度和比例 Length and Ratio of Line Segments

距離/長度。線段 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²).

沿 y = 2 移動 P:綠色垂線就是點至直線的距離,P(1, 2) 時是 1.2。 Slide P along y = 2: the green perpendicular is the distance to the line, 1.2 at P(1, 2).
↑ 返回頁頂 Back to top

比例(中點公式/截點公式) Ratio (Mid-point Formula / Section Formula)

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)).

改變比例 n:P 把 AB 分成 1 : n,n = 2 時 P 是 (4, 1)。 Change the ratio n: P divides AB in the ratio 1 : n, and n = 2 gives P(4, 1).
↑ 返回頁頂 Back to top

兩條直線之間的關係 Relationship between Two Lines

平面上兩條直線,不是相交於一點,就是永不相交(平行);如果它們相交成直角,就是垂直。

Two lines on a plane either meet at a point, or never meet (parallel). When they meet at a right angle they are perpendicular.

↑ 返回頁頂 Back to top

兩條線之間的交點 Intersection of Two Lines

交點是同時在兩條直線上的點,所以把兩條方程聯立(消元或代入)求解。要判斷三條直線是否共點,先求其中兩條的交點,再檢查該點是否在第三條直線上。

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.

移動紅線:它與藍線的交點沿藍線移動,c = 2 時得出解 (3, 1)。 Slide the red line: its intersection with the blue line moves along it, and c = 2 gives the solution (3, 1).
↑ 返回頁頂 Back to top

兩條線之間的平行/垂直 Parallel and Perpendicular Lines

兩直線平行,斜率相等: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.

拖動紅線的斜率 m:m 等於 3/4 時平行,m × 3/4 = −1 時垂直。 Drag the slope m of the red line: parallel when it equals 3/4, perpendicular when m × 3/4 = −1.
↑ 返回頁頂 Back to top

直線方程例題詳解 Worked Examples

例題 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).

  1. m = (7 − 3)/(3 − 1) = 2
  2. y − 3 = 2(x − 1)

答案: Answer: 2x − y + 1 = 0。2x − y + 1 = 0.

例題 2 Example 2:由一般式求斜率及截距 Slope and intercepts from the general form

求 2x − 3y + 12 = 0 的斜率及截距。Find the slope and the intercepts of 2x − 3y + 12 = 0.

直線 2x − 3y + 12 = 0 與兩軸相交於 (−6, 0) 及 (0, 4):斜率 = 垂直增量 ÷ 水平增量 = 4/6 = 2/3。 The line 2x − 3y + 12 = 0 cuts the axes at (−6, 0) and (0, 4): slope = rise ÷ run = 4/6 = 2/3.
逐步解答 Show the steps
  1. Slope = −A/B = 2/3.
  2. 令 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.

例題 3 Example 3:兩直線的交點 Intersection of two lines

求 2x + y − 7 = 0 與 x − y − 2 = 0 的交點。Find the point where 2x + y − 7 = 0 and x − y − 2 = 0 meet.

  1. 兩式相加:3x − 9 = 0,所以 x = 3。Add the equations: 3x − 9 = 0, so x = 3.
  2. 把 x = 3 代入 x − y − 2 = 0:y = 1。Put x = 3 into x − y − 2 = 0: y = 1.

答案: Answer: (3, 1)。(3, 1).

例題 4 Example 4:點至直線的距離 Distance from a point to a line

求 (1, 2) 至直線 3x + 4y − 5 = 0 的距離。Find the distance from (1, 2) to the line 3x + 4y − 5 = 0.

  1. |3(1) + 4(2) − 5| = 6 and √(3² + 4²) = 5.

答案: Answer: 6/5 = 1.2。6/5 = 1.2.

例題 5 Example 5:由頂點坐標求三角形面積 Area of a triangle from its vertices

求頂點為 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).

沿 y = 6 移動 C:三角形面積隨 ½ |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)| 改變;C = (3, 6) 時是 9。 Slide C along y = 6: the area of the triangle changes with ½ |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)|; C = (3, 6) gives 9.
逐步解答 Show the steps
  1. 1(2 − 6) + 5(6 − 1) + 3(1 − 2) = −4 + 25 − 3 = 18
  2. Area = ½ × |18|

答案: Answer: 9 平方單位。9 square units.

例題 6 Example 6:按比例內分線段 Point dividing a segment in a ratio

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.

  1. x = (2 × 2 + 1 × 8) / 3 = 4
  2. y = (2 × (−1) + 1 × 5) / 3 = 1

答案: Answer: P = (4, 1)。P = (4, 1).

↑ 返回頁頂 Back to top

💡 應試陷阱與秘訣 Exam Traps & Secrets

⚠️ 負斜率與傾角 Negative slope and the angle of inclination斜率為負時,tan θ 為負,傾角是鈍角:θ = 180° −(計數機給出的銳角)。When the slope is negative, tan θ is negative and the angle of inclination is obtuse: θ = 180° − (the acute angle your calculator gives).
拖動斜率:斜率為負時,傾角是鈍角,即 180° 減去銳角。 Drag the slope: for a negative slope the angle of inclination is obtuse, 180° minus the acute angle.
⚠️ 斜率的分母為零 Dividing by zero in the slope若 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 = ∞.
把直線轉向鉛垂:tan θ 無限增大,到 90° 時斜率沒有定義(直線是 x = 常數)。 Turn the line towards vertical: tan θ grows without limit and at 90° the slope is undefined (the line is x = constant).
↑ 返回頁頂 Back to top

✏️ 自我測試:互動練習 Self-Test: Interactive Practice

溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。How to study: click any question to load it on the coordinate grid and check your steps.

(點斜式 Point-slope form)求通過 (2, −1)、斜率為 3 的直線方程。Find the equation of the line through (2, −1) with slope 3.
(點至直線 Point to line)求 (1, 2) 至 3x + 4y − 5 = 0 的距離。Find the distance from (1, 2) to 3x + 4y − 5 = 0.
(m₁ × m₂ = −1)2x + 3y = 5 與 3x − 2y = 1 是否垂直?Are 2x + 3y = 5 and 3x − 2y = 1 perpendicular?
↑ 返回頁頂 Back to top

直線方程練習題(DSE 模擬題) Exercises: DSE-Style Practice

SketchMath 題庫內的 DSE 風格練習,選擇題及長題目均附解答。 DSE-style practice from the SketchMath question bank, with solutions for every MC and long question.

直線的方程 · 中四
20 條選擇題 20 MC
距離、中點及斜率(DSE) · 中四
18 條選擇題 18 MC
直線的坐標幾何 · 中三
37 條選擇題 37 MC · 25 條長題目 25 long questions

常見問題 Frequently Asked Questions

↑ 返回頁頂 Back to top

相關主題 Related Topics

軌跡 Locus圓的方程 Equations of Circles更多關於三角學 More about TrigonometryHKDSE 數學全部課題 HKDSE Math: all topicsDSE 數學公式表(全課題) HKDSE Maths Formula SheetDSE 數學練習(按年級) DSE Maths Practice by Form
直線方程 DSE 練習題 Try a DSE Practice Question