# Lines

The key to understanding a line in the coordinate plane is the slope.
## Points and slopes

You'll want to learn this formula:
*m* =
(*y*_{2} − *y*_{1}) ÷
(*x*_{2} − *x*_{1}).

In this formula, you start with two points and calculate the slope:
- The first point is (
*x*_{1}, *y*_{1}),
and the second point
is (*x*_{2}, *y*_{2}).
- The
**rise**
is *y*_{2} − *y*_{1},
which is how much you move *up*;
the rise is negative if you actually move *down*.
- The
**run**
is *x*_{2} − *x*_{1},
which is how much you move to the *right*;
the run is negative if you actually move to the *left*.
- The
**slope** is the rise divided by the run,
which is usually denoted by *m*;
it is the same for any two distinct points on the same line.

The slope describes the directions in which you can travel along the line.

- Lines with positive slope run up–right and down–left;
lines with negative slope run down–right and up–left.
- Lines whose slope has a large absolute value are steep;
lines whose slope has a small absolute value (close to zero) are shallow.
- Horizontal lines have a slope of exactly zero;
vertical lines have a slope which is undefined
(which you can sometimes think of as an infinite slope).

Avoid saying that a line ‘has no slope’,
since this could mean either that the slope is zero (a horizontal line)
or that the slope does not exist as a real number (a vertical line);
instead either say ‘the slope is zero’
or ‘the slope is undefined’,
whichever you mean.
## Slopes and equations

You'll want to learn this formula:
In this formula, you get the equation of a line.
- The slope is the number
*m*.
- The
*y*-intercept is (0, *b*).
- The variables
*x* and *y* stay in the equation.

In case you don't know the *y*-intercept,
you can still use this equation if you know one of the points;
plug it in for *x* and *y*, and solve for *b*.
Or use either form of this optional formula:

*y* − *y*_{1} =
*m*(*x* − *x*_{1});
*y* =
*m*(*x* − *x*_{1}) +
*y*_{1}.

Conversely, if you have an equation for the line,
then solve it for *y*;
you now know what the slope and *y*-intercept are.
It's easy to draw a graph using those (or using the slope and any other point):
the *y*-intercept (or other point) tells you where to start,
and then the slope tells you how to move.

## Vertical lines

If a line is vertical,
then the the run between any two points is zero,
so the slope is undefined when you divide by the run.
You can also think of this as an infinite slope,
since a vertical line is infinitely steep.
If *a* is the *x*-coordinate of any point,
then the equation for a vertical line is always simply:

## Parallel and perpendicular lines

Since the slope of a line indicates its direction,
parallel lines always have the same slope.
In contrast, perpendicular lines have opposite reciprocal slopes.
- Parallel lines:
*m*_{1} = *m*_{2}
(as long as they are not the same line).
- Perpendicular lines:
*m*_{1}*m*_{2} = −1,
or *m*_{2} = −1/*m*_{1}.

Also, vertical lines are parallel to one another,
and horizontal and vertical lines are each perpendicular to each other.

Go back to the course homepage.

This web page was written between 2010 and 2018 by Toby Bartels,
last edited on 2018 August 20.
Toby reserves no legal rights to it.
The permanent URI of this web page
is
`http://tobybartels.name/MATH-0950/2018SU/lines/`

.