Lines Revisited: Slope and General Form
Learning objectives
- Write the general form ax + by + c = 0 of a line
- Find the normal vector to a line
- Compute the distance from a point to a line
- Convert between slope-intercept and general form
The slope-intercept form is the line you first met. It is fine for sketching, but analytic geometry needs a form that is more symmetric and that does not break down for vertical lines. The general form treats and on equal footing and instantly reveals the line's normal vector, which is the key to computing distances from points to lines, a tool you will use again and again in the conic sections to follow.
General form
Every straight line in the plane satisfies an equation of the form
The pair controls the direction; the scalar slides the line parallel to itself. Vertical lines correspond to ; horizontal lines correspond to . Slope-intercept cannot express vertical lines, general form can.
The normal vector is the gradient
The vector points perpendicular to the line. Why? Because if and both satisfy , subtracting gives , i.e. . The dot product vanishes, so is perpendicular to every direction along the line.
The direction vector along the line is (rotate the normal by ). Either choice of sign works.
- Computer Vision: The general-form line is the natural output of the Hough transform; is the line's normal vector, and encodes its signed distance from the origin.
- Image Processing: Edge-detection filters output gradient vectors that point along the normal of local edges; aligning these normals across pixels is how line-detection algorithms find roads, walls, and text.
- Machine Learning: Half-spaces are the building blocks of linear-programming feasible regions and of support-vector-machine classifiers; both are general-form lines used as decision boundaries.
(Drag the two points to redraw the line. The widget displays both the general form and the slope-intercept form, so you can see them as two views of the same object.)
Distance from a point to a line
The most-used formula in this chapter is
where is the external point and is the line. The numerator is the signed value of the line equation at the point; the denominator is the length of the normal vector. Dividing turns "how much does this point miss the equation by" into a true Euclidean distance.
Converting between forms
From slope-intercept: becomes , so .
From general form: if , the slope is and the -intercept is . Two lines are parallel when ; they are perpendicular when (dot product of normals is zero).
Try it
- Find the distance from to . (Plug into the formula.)
- Write in general form with integer coefficients. (Multiply through by .)
- Find the angle between the two lines and . (Use the normals: their dot product divided by the product of lengths gives .)
Pause: is really general, or is it missing some lines? It is missing all vertical lines, because they have undefined slope. The general form fixes this gap.
A trap to watch for
The distance formula needs the line in general form. If you have and you plug into , you do not get the distance, you get the vertical gap from the point to the line. To get the perpendicular distance, you must first rewrite as , then divide by . Forgetting the denominator overestimates the distance by a factor of , which can be huge for steep lines.
What you now know
You can write any line in general form (including verticals), identify the normal vector, compute the perpendicular distance from a point, and translate between slope-intercept and general form. The next section turns these coordinate-method tools loose on curved figures, starting with the parabola.
Quick check
Mark section complete →
References
- Lang, S. (1971). Basic Mathematics. Springer. Chapter 12, §1, the general-form approach to the line in analytic geometry.
- Apostol, T. M. (1969). Calculus, Volume 2. Wiley. Chapter 1: lines and planes in vector form, including the point-to-line distance derivation.
- Hartshorne, R. (2000). Geometry: Euclid and Beyond. Springer. Chapter 3: analytic and synthetic treatments of lines side by side.