In math, the equation for the slope of a line that is straight is:
m = y2-y1x2-x1
(x1,y1) are the coordinates of two different points on the line: (x2,y2) There are many ways to measure the slope of a line, but for this lesson, we only want to look at horizontal and vertical lines:
Horizontal Line: A horizontal line with zero slopes or a bar with slope m = 0.
Vertical Line: A vertical line is a line that has an undefined slope, or it is a line in which the denominator of the slope equation is zero, which results in an undefined slope.
The following are some examples of horizontal and vertical lines.
y = 3 is a horizontal line that crosses the y-axis at (0,3).
x = 2 is a vertical line that crosses the x-axis at (2,0).
What Is the Slope of a Vertical Line?
The slope of a vertical line can’t be found. This is because, in a horizontal line, the change in the value of x will always be 0. Calculating the difference between the two x-coordinates can help you figure this out. Remember that the slope formula can help you:
y2-y1x2-x1
With a vertical line, the bottom denominator is 0 with this method. It’s not possible to divide by 0 in math, though. Divide any number by any change in y-coordinate, and you’ll get an undefined slope, even though y-coordinate might change.
Remember the Slope Formula
Make sure you know how to figure out the slope of a linear equation when you’re graphing them. You can figure it out by dividing the vertical change in a point by the horizontal change.
However, consider these two cases: Horizontal lines have a slope of 0 because there is no change in the vertical direction. It’s hard to figure out how steep vertical lines are because you can’t divide 0 by a number.
Finding Slope
Slope can be easily found in a linear equation by writing the equation in slope-intercept form, or y=mx+b (opposed to standard format).
Here, the variable m stands for the slope. You can have a positive slope or a negative slope based on the value of the slope.
If you want to make a horizontal line, you can use the same formula as a slope-intercept line, but without the mx. That means it doesn’t have a slope!
It can’t be done with formulas for vertical lines, like x = 4. We’re going to show you later on why this is.
What Is the Slope of a Horizontal Line?
In this case, there is 0 slope because the line doesn’t rise at all. There will always be no difference in y-value between two points on a straight line.
Equations for horizontal and vertical lines
Vertical and horizontal lines follow linear equations, but they don’t have to. The typical equation for a straight line is y = m x + b .
The y-intercept is the point where lines meet the y axis. In this case, m is the slope, and b is the point where the two lines meet. The slope formula gives the slope from the previous page:
- The slope now means that m = y2–y1x2–x1 . If the slope is zero, this means that y2=y1. It must be horizontal because the y-values are the same for any two y-values chosen on the line, which means the line must be straight. This leads us to the equation of a horizontal line, as shown in the figure:
For some natural number c,y=c. In this case, the y-values are held steady on the horizontal line, so y must be some fixed value.
Similarly, vertical lines come from an unknown slope. Isn’t it true that when the slope m isn’t known, it means it’s the same as when it isn’t known? Therefore, it’s the same as when it’s not known. Because the x-values are the same for any two x-values chosen on the line, the line must be vertical. This leads to the equation of a vertical line x=c
For some natural number c,x=c. This is because x-values stay the same on the vertical line, which means that x must remain the same.
This means that you can figure out the slope if you know either a horizontal or vertical line equation. y = c = 0 if the equation is about a horizontal line, which means it looks like this: y = c. It doesn’t matter which two points you pick on the line. The equation for the slope will always be 0 /x = 0.
Also, the slope of a vertical line with the form x = c can be found. Because we choose two points on the line, the slope will be m which is unclear. This means that the slope is not known.
Because no examples of horizontal lines or vertical lines were given, these slope values will apply to all horizontal and vertical lines since there were no examples. Here are a few:
y = 5 has slope zero since it is a horizontal line.
y = − π also has a zero slope because it is also a horizontal line.
x = − 3 has an undefined slope since it is a vertical line.
x = 100 also has an undefined slope since it is also a vertical line.
Conclusion
People often mix up these two types of lines and their slopes, but they are very different.
Horizontal and vertical are not the same thing at all. Zero slopes are not the same as no slope, and neither is “no slope.”
Z and N are not the same things. “Zero slopes” for a horizontal line are not the same as “No slope” for a horizontal line (for a vertical line).
Horizontal lines have a slope because the number “zero” is actual. But vertical lines don’t have a slope; “slope” doesn’t make sense for vertical lines.