In short

A straight line in the coordinate plane can be written in several equivalent forms: slope-intercept (y = mx + c), point-slope (y - y_1 = m(x - x_1)), two-point, intercept (x/a + y/b = 1), and normal (x\cos\alpha + y\sin\alpha = p). Each form is best suited to a specific set of starting information. The key idea behind all of them is slope — the number that measures how steep the line is.

Stand on a straight road that climbs a hill. For every 100 metres you walk forward (horizontally), the road rises 15 metres. The steepness of that road is 15/100 = 0.15. Walk 200 metres forward, the road rises 30 metres — the ratio stays the same.

That ratio — rise divided by run — is called the slope of the road. It is a single number that completely describes the steepness and direction of any straight path. A flat road has slope 0. A road that goes uphill to the right has a positive slope. A road going downhill to the right has a negative slope. A steeper hill has a larger slope.

Slope is the first thing you need to talk about straight lines in coordinate geometry. Once you have it, every equation of a straight line is just slope plus one more piece of information — a point the line passes through, or a distance from the origin, or where it crosses the axes.

Slope of a line

The definition

Take two points on a line: A(x_1, y_1) and B(x_2, y_2). The slope of the line through A and B is:

m = \frac{y_2 - y_1}{x_2 - x_1}

The numerator y_2 - y_1 is the vertical change — how much the line rises (or falls) between the two points. The denominator x_2 - x_1 is the horizontal change — how far you move along the x-axis. The ratio is the rise per unit of run.

The slope of the line through $A(1,1)$ and $B(5,4)$ is $\frac{4-1}{5-1} = \frac{3}{4}$. For every $4$ units you move to the right, the line rises $3$ units.

A key fact: the slope does not depend on which two points you pick. If you pick different points C and D on the same line, you get the same slope. This is because all the right triangles you can form between points on a line are similar — same angles, same ratios. Slope is a property of the line, not of the pair of points.

Slope and angle of inclination

The angle of inclination of a line is the angle \theta that the line makes with the positive x-axis, measured counterclockwise. The slope and the angle are related by:

m = \tan\theta

This makes sense geometrically. In the right triangle formed by the rise and run, the angle at the base is \theta. The tangent of that angle is opposite/adjacent = rise/run = m.

Some important cases:

Parallel and perpendicular lines

Two lines are parallel if and only if they have the same slope: m_1 = m_2.

Two lines are perpendicular if and only if the product of their slopes is -1: m_1 \cdot m_2 = -1, or equivalently m_2 = -1/m_1.

The perpendicularity condition deserves a quick proof. If line 1 makes angle \theta_1 with the x-axis and line 2 makes angle \theta_2 = \theta_1 + 90°, then:

m_1 \cdot m_2 = \tan\theta_1 \cdot \tan(\theta_1 + 90°) = \tan\theta_1 \cdot (-\cot\theta_1) = \tan\theta_1 \cdot \frac{-1}{\tan\theta_1} = -1

(using \tan(\theta + 90°) = -\cot\theta). The condition m_1 m_2 = -1 follows directly.

The six forms of a straight line

1. Slope-intercept form

If you know the slope m and the y-intercept c (the value of y where the line crosses the y-axis), the equation is:

y = mx + c

Why this works. The line crosses the y-axis at (0, c). From there, for every unit you move right, y increases by m. So at a general point x, the value of y is c + m \cdot x.

Example. A line with slope 2 and y-intercept -3: y = 2x - 3.

This is the most commonly used form because it is the simplest: just two parameters, both with clear geometric meanings. It is also the form you use when graphing — plot the y-intercept, then use the slope to find a second point.

Limitation. This form cannot represent a vertical line (x = k), because a vertical line has undefined slope. Every other line in the plane has a unique slope-intercept representation.

2. Point-slope form

If you know the slope m and one point (x_1, y_1) on the line, the equation is:

y - y_1 = m(x - x_1)

Derivation. Take any other point (x, y) on the line. The slope between (x_1, y_1) and (x, y) must equal m:

\frac{y - y_1}{x - x_1} = m

Multiply both sides by (x - x_1):

y - y_1 = m(x - x_1)

That is the entire derivation — one application of the slope definition. This form is the most useful when you are given a point and a slope (or can compute the slope from some other condition, like parallelism or perpendicularity).

3. Two-point form

If you know two points (x_1, y_1) and (x_2, y_2) on the line, first compute the slope:

m = \frac{y_2 - y_1}{x_2 - x_1}

Then use the point-slope form with either point:

y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)

This is not a separate formula — it is the point-slope form with the slope written out explicitly. Some textbooks present it as a separate "form," but it is really just the obvious combination of the slope formula and the point-slope equation.

4. Intercept form

If you know the x-intercept a (where the line crosses the x-axis) and the y-intercept b (where the line crosses the y-axis), the equation is:

\frac{x}{a} + \frac{y}{b} = 1

Derivation. The line passes through (a, 0) and (0, b). Compute the slope: m = \frac{b - 0}{0 - a} = -\frac{b}{a}.

Use the point-slope form with the point (a, 0):

y - 0 = -\frac{b}{a}(x - a)
y = -\frac{b}{a}x + b
\frac{b}{a}x + y = b

Divide both sides by b:

\frac{x}{a} + \frac{y}{b} = 1

Verification. At (a, 0): \frac{a}{a} + \frac{0}{b} = 1. At (0, b): \frac{0}{a} + \frac{b}{b} = 1. Both check out.

This form is compact and elegant. It is especially useful in problems where the intercepts are the given data — for instance, "a line cuts the positive x-axis at 3 and the positive y-axis at 4."

Limitation. This form cannot represent lines through the origin (both intercepts are zero), or lines parallel to an axis (one intercept is infinite).

The line $\frac{x}{3} + \frac{y}{4} = 1$ passes through $(3, 0)$ and $(0, 4)$. The intercept form directly encodes the two axis crossings.

5. Normal form

This is the most elegant form, and the least intuitive on first encounter. Instead of describing the line by its slope and a point, you describe it by its distance from the origin and the direction of the perpendicular from the origin to the line.

Let p be the perpendicular distance from the origin to the line, and let \alpha be the angle that this perpendicular makes with the positive x-axis. Then the equation of the line is:

x\cos\alpha + y\sin\alpha = p

where p > 0.

Derivation. The foot of the perpendicular from the origin to the line is the point N(p\cos\alpha, p\sin\alpha) — this is the point at distance p from the origin in the direction \alpha.

The line is perpendicular to ON at N. The direction of ON is (\cos\alpha, \sin\alpha), so the line is perpendicular to this direction.

A point (x, y) lies on the line if and only if the vector from N to (x, y) is perpendicular to the direction (\cos\alpha, \sin\alpha). The perpendicularity condition (dot product equals zero) is:

(x - p\cos\alpha)\cos\alpha + (y - p\sin\alpha)\sin\alpha = 0
x\cos\alpha - p\cos^2\alpha + y\sin\alpha - p\sin^2\alpha = 0
x\cos\alpha + y\sin\alpha = p(\cos^2\alpha + \sin^2\alpha) = p

So x\cos\alpha + y\sin\alpha = p.

Normal form of a lineA diagram showing a line, the perpendicular from the origin to the line, the foot of perpendicular N, the distance p, and the angle alpha. The origin is at the bottom-left, the perpendicular goes from the origin to point N on the line, making angle alpha with the x-axis. x y N p α
The normal form. The line is described by the perpendicular distance $p$ from the origin and the angle $\alpha$ that the perpendicular makes with the $x$-axis. The foot of the perpendicular is $N$. The small square at $N$ marks the right angle.

The normal form may seem like an odd way to describe a line, but it has a major advantage: the distance p appears explicitly in the equation. This makes it trivially easy to compute the distance from the origin to any line — just convert to normal form and read off p. It is also the form used in many physics and engineering contexts, where the "closest approach" distance is what matters.

Converting between forms

Any line can be written in any of these forms (with the noted exceptions for vertical lines and lines through the origin). Here is a summary of how to convert:

Slope-intercept to normal form. Start with y = mx + c, rewrite as mx - y + c = 0. The normal form requires dividing by \sqrt{m^2 + 1} (the magnitude of the coefficient vector (m, -1)) and choosing the sign so that p > 0:

\frac{mx - y + c}{\pm\sqrt{m^2 + 1}} = 0 \quad \Longrightarrow \quad x \cdot \frac{m}{\sqrt{m^2+1}} + y \cdot \frac{-1}{\sqrt{m^2+1}} = \frac{-c}{\sqrt{m^2+1}}

Here \cos\alpha = \frac{m}{\sqrt{m^2+1}} and \sin\alpha = \frac{-1}{\sqrt{m^2+1}}, with the sign of the whole expression chosen so that p = \frac{|c|}{\sqrt{m^2+1}} > 0.

Intercept form to slope-intercept. From x/a + y/b = 1: solve for y to get y = -\frac{b}{a}x + b. So the slope is -b/a and the y-intercept is b.

Normal form to slope-intercept. From x\cos\alpha + y\sin\alpha = p: solve for y to get y = -\frac{\cos\alpha}{\sin\alpha}x + \frac{p}{\sin\alpha}. So the slope is -\cot\alpha and the y-intercept is p/\sin\alpha.

Worked examples

Example 1: Finding the equation in multiple forms

A line passes through A(2, 3) and has slope -\frac{1}{2}. Find its equation in (a) point-slope form, (b) slope-intercept form, and (c) intercept form.

Step 1 (Point-slope form). Directly apply y - y_1 = m(x - x_1) with (x_1, y_1) = (2, 3) and m = -1/2:

y - 3 = -\frac{1}{2}(x - 2)

Why: the point-slope form requires exactly one point and the slope. Both are given, so this is a direct substitution.

Step 2 (Slope-intercept form). Expand and simplify:

y - 3 = -\frac{1}{2}x + 1
y = -\frac{1}{2}x + 4

Why: distributing -1/2 over (x-2) gives -x/2 + 1, and adding 3 to both sides gives the y-intercept: c = 4.

Step 3 (Find the intercepts). The y-intercept is c = 4, so b = 4. For the x-intercept, set y = 0: 0 = -x/2 + 4, so x = 8, meaning a = 8.

Why: the y-intercept is already visible in the slope-intercept form. The x-intercept is found by solving for x when y = 0.

Step 4 (Intercept form). With a = 8 and b = 4:

\frac{x}{8} + \frac{y}{4} = 1

Why: direct substitution of the intercepts into the intercept-form template.

Step 5 (Verify). Does A(2,3) satisfy \frac{x}{8} + \frac{y}{4} = 1? Check: \frac{2}{8} + \frac{3}{4} = \frac{1}{4} + \frac{3}{4} = 1. Correct.

Result: Point-slope: y - 3 = -\frac{1}{2}(x - 2). Slope-intercept: y = -\frac{1}{2}x + 4. Intercept: \frac{x}{8} + \frac{y}{4} = 1.

The line through $A(2,3)$ with slope $-1/2$. It crosses the $y$-axis at $(0,4)$ and the $x$-axis at $(8,0)$. Three forms, one line — the geometry is the same regardless of which equation you write.

All three forms describe the same line. The point-slope form makes the given point visible. The slope-intercept form makes the y-intercept visible. The intercept form shows both axis crossings at a glance. Choosing a form is choosing what you want to emphasise.

Example 2: Finding the equation in normal form

Find the equation of the line that is at a perpendicular distance of 3 from the origin, with the perpendicular making an angle of 60° with the positive x-axis.

Step 1. Identify the parameters for the normal form: p = 3 and \alpha = 60°.

Why: the normal form is x\cos\alpha + y\sin\alpha = p, and the problem gives p and \alpha directly.

Step 2. Compute the trigonometric values: \cos 60° = 1/2 and \sin 60° = \sqrt{3}/2.

Why: these are standard values from the 30°-60°-90° triangle.

Step 3. Substitute into the normal form:

x \cdot \frac{1}{2} + y \cdot \frac{\sqrt{3}}{2} = 3
x + \sqrt{3}\,y = 6

Why: multiplying both sides by 2 clears the fractions and gives the simplest integer-coefficient form.

Step 4. Find the slope and intercepts for verification. From x + \sqrt{3}y = 6: y = -\frac{1}{\sqrt{3}}x + \frac{6}{\sqrt{3}} = -\frac{x}{\sqrt{3}} + 2\sqrt{3}. The slope is -1/\sqrt{3}, the y-intercept is 2\sqrt{3} \approx 3.46, and the x-intercept is 6.

Why: converting to slope-intercept form serves as a check and makes the line easier to plot.

Step 5. Verify the perpendicular distance from the origin. The formula for distance from (0,0) to ax + by + c = 0 is |c|/\sqrt{a^2 + b^2}. Rewrite x + \sqrt{3}y - 6 = 0: distance = \frac{|-6|}{\sqrt{1 + 3}} = \frac{6}{2} = 3. Confirmed.

Result: The line is x + \sqrt{3}\,y = 6, or equivalently x\cos 60° + y\sin 60° = 3.

The line $x + \sqrt{3}\,y = 6$ in normal form. The perpendicular from the origin to the line has length $p = 3$ and makes an angle of $60°$ with the $x$-axis. The foot of the perpendicular is $N(3\cos 60°, 3\sin 60°) = (1.5, 2.598)$.

The normal form is the natural choice when the problem is stated in terms of distance from the origin and direction of the perpendicular. Converting to other forms is always possible — the normal form is just a different lens on the same line.

How to choose the right form

Here is a decision guide. Given a problem about a straight line, look at what information you have, and pick the form that uses that information directly.

You know Use this form Equation
Slope and y-intercept Slope-intercept y = mx + c
Slope and a point Point-slope y - y_1 = m(x - x_1)
Two points Two-point (then simplify) y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)
Both intercepts Intercept \frac{x}{a} + \frac{y}{b} = 1
Perpendicular distance and angle Normal x\cos\alpha + y\sin\alpha = p

The forms are not competing — they are the same object viewed from different angles. The slope-intercept form is the one you will use most, because slope and y-intercept are the most commonly available data. The normal form is the most elegant but the least commonly needed at the introductory level.

Special lines

Some lines deserve special mention because they come up constantly.

Horizontal lines. y = k for some constant k. Slope is 0. Parallel to the x-axis.

Vertical lines. x = k for some constant k. Slope is undefined. Parallel to the y-axis. Cannot be written in slope-intercept form.

Lines through the origin. y = mx — the slope-intercept form with c = 0. These cannot be written in intercept form because both intercepts are 0 (and you cannot divide by zero).

The line y = x. Slope 1, angle of inclination 45°. This line is the locus of points with equal x- and y-coordinates.

The line y = -x. Slope -1, angle of inclination 135°. Perpendicular to y = x.

Common confusions

Going deeper

If you came here to learn the six forms of a straight line and when to use them, you have it — you can stop here. The rest of this section covers some deeper connections: the general equation, the distance formula, and the relationship between the normal form and projections.

The general equation of a line

Every straight line in the plane can be written as:

ax + by + c = 0

where a, b, c are constants and a and b are not both zero. This is the most general form — it can represent every line, including vertical lines (set b = 0) and horizontal lines (set a = 0).

Every form you have seen is a special case:

The general equation ax + by + c = 0 is covered in detail in the article on General Equation of a Straight Line.

Distance from a point to a line

One of the most useful results in coordinate geometry: the perpendicular distance from a point (x_0, y_0) to the line ax + by + c = 0 is:

d = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}

Derivation. Convert the line to normal form. Divide ax + by + c = 0 by \sqrt{a^2 + b^2}:

\frac{a}{\sqrt{a^2 + b^2}}x + \frac{b}{\sqrt{a^2 + b^2}}y + \frac{c}{\sqrt{a^2 + b^2}} = 0

This is in the form x\cos\alpha + y\sin\alpha = p, where \cos\alpha = \frac{a}{\sqrt{a^2+b^2}}, \sin\alpha = \frac{b}{\sqrt{a^2+b^2}}, and p = \frac{-c}{\sqrt{a^2+b^2}}.

For any point (x_0, y_0), the signed distance from the origin to the line through (x_0, y_0) parallel to the given line is x_0\cos\alpha + y_0\sin\alpha. The signed distance from the origin to the given line itself is p. The perpendicular distance from (x_0, y_0) to the given line is the absolute difference:

d = |x_0\cos\alpha + y_0\sin\alpha - p| = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}

This formula is used throughout coordinate geometry — in finding the distance between parallel lines, the area of a triangle, the equations of angle bisectors, and much more. It appears in virtually every JEE coordinate geometry problem.

The normal form and the dot product

The normal form x\cos\alpha + y\sin\alpha = p has a beautiful interpretation in terms of vectors.

The unit vector in the direction of the perpendicular from the origin is \hat{n} = (\cos\alpha, \sin\alpha). The position vector of any point P on the line is \vec{r} = (x, y). The equation x\cos\alpha + y\sin\alpha = p says:

\vec{r} \cdot \hat{n} = p

In words: the projection of \vec{r} onto the direction of the perpendicular equals the perpendicular distance p. This is the dot-product interpretation of a line: a line is the set of all points whose position vectors have the same projection onto a fixed direction.

This interpretation generalises immediately to three dimensions. A plane in 3D is described by \vec{r} \cdot \hat{n} = p, where \hat{n} is the unit normal to the plane. The normal form of a line in 2D is the two-dimensional version of the equation of a plane.

Families of lines

Given a line L_1: a_1x + b_1y + c_1 = 0 and a line L_2: a_2x + b_2y + c_2 = 0, the equation

a_1x + b_1y + c_1 + \lambda(a_2x + b_2y + c_2) = 0

represents a family of lines passing through the intersection of L_1 and L_2, for different values of the parameter \lambda. Every line through the intersection (except L_2 itself) can be obtained by choosing the right \lambda.

This is a powerful technique for finding lines through an intersection point without actually computing the intersection. If you need a line through the intersection of 2x + 3y = 6 and x - y = 1 that also passes through the origin, write 2x + 3y - 6 + \lambda(x - y - 1) = 0 and set x = 0, y = 0: -6 - \lambda = 0, so \lambda = -6. The line is 2x + 3y - 6 - 6(x - y - 1) = 0, which simplifies to -4x + 9y = 0, or 4x = 9y.

Where this leads next

The equation of a straight line is the foundation of coordinate geometry. Once you have it, the next set of articles builds the full theory of straight lines and then extends to curves.