Pulsars
0 %
Log inSign up

Vectors and straight lines in the plane

Cartesian equation of a straight line

Reduced form

A straight line that is not parallel to the y-axis can be expressed by the equation:

y = m*x + p

where m is the slope and p is the y-intercept, i.e. the value of y when x = 0.

Calculating the slope

For two points A(xA; yA) and B(xB; yB) on the same straight line, where xA is different from xB:

m = (yB - yA) / (xB - xA)

Example: A(1; 2), B(3; 6). We calculate m = (6–2)/(3–1) = 4/2 = 2. The line has the equation y = 2x + p. Substituting A: 2 = 2 × 1 + p, so p = 0. The equation is y = 2x.

General form

Any line, even a vertical one, can be written in the general form ax + by + c = 0. Vertical lines (x = k) do not have a slope, as m would involve division by 0.

Special cases

Equation Type of line
y = p horizontal
x = k vertical
y = m*x + p, m > 0 increasing
y = m*x + p, m < 0 decreasing

Pitfalls to avoid

  • Do not confuse m (slope, related to the gradient) and p (y-intercept, the point where the line intersects the y-axis).
  • A vertical line x = k does not have a standard form y = mx + p.
  • Two lines are parallel if and only if they have the same slope m.