Slope: how steep, and in which direction
The slope of a line through two points measures its steepness as a single honest ratio: rise over run, the change in height divided by the change in horizontal position. A slope of 2, the default example on this page, means the line climbs two units for every one unit it moves across — steep, and getting steeper-sounding slopes quickly outrun intuition, since a slope of 1 is already a 45-degree line. Enter any two points and this calculator returns the slope together with the line's midpoint, the distance between the points, and the angle the line makes with the horizontal, because in practice those four facts are asked for together.
Sign carries meaning in a slope. A positive slope climbs as you move rightwards; a negative slope descends; a slope of exactly zero is a perfectly horizontal line, where y never changes. The size matters as much as the sign: slopes between −1 and 1 are gentler than 45 degrees, and beyond that the line is steeper than it is wide. Road engineers quote the same idea as a percentage grade — a slope of 0.08 is an 8% grade — roofers as rise over a standard 12-unit run, and accessibility standards as strict maximum ratios, because a ramp is a slope people must actually climb.
The slope formula and its one honest exception
Subtract the y values for the rise, subtract the x values in the same order for the run, and divide. Order discipline is the whole game: whichever point you call first, use it first in both subtractions, or the sign flips. The one exception is a vertical line, where both points share an x value: the run is zero, division by zero is impossible, and the correct answer — given here plainly — is that the slope is undefined. Not zero, not infinite: undefined, with the angle reported as 90 degrees and the distance and midpoint still perfectly meaningful.
Midpoint and distance: the companions of slope
The midpoint is the average of the coordinates — halfway across and halfway up — and it answers everything from where to place a label on a map segment to where two delivery routes should meet. The distance is the Pythagorean theorem in disguise: the run and the rise are the two legs of a right triangle, and the straight-line gap between the points is its hypotenuse, which is why the working panel shows the distance as a square root of summed squares. That single idea — slope for steepness, Pythagoras for distance — describes almost any two-point situation, from the gradient of a garden path to the pitch of a roof you are measuring from a satellite photo with two corners picked out.
The angle, and moving between angle and slope
The angle reported here is measured in degrees from the positive x direction, turning anticlockwise. It and the slope are the same information in two dialects: the slope is the tangent of the angle, so a 45-degree line has slope 1, a 63.4-degree line has slope 2, and as the angle approaches 90 degrees the slope grows without bound — the honest reason a vertical line has no finite slope at all. Surveyors, game developers and anyone rotating a line on screen tend to think in angles; algebra and data analysis, where slope is the rate of change of one quantity with respect to another, think in ratios. Being able to read both, as this page presents them side by side, is what makes the geometry feel like one subject instead of two.
Worked example
Through (1, 2) and (5, 10): the rise is 10 − 2 = 8, the run is 5 − 1 = 4, so the slope is 2. The midpoint is (3, 6), the distance is about 8.9443, and the angle is about 63.4349 degrees.
How to use this calculator
- Enter the first point as x1 and y1.
- Enter the second point as x2 and y2.
- Read the slope in the green panel — vertical lines are reported as undefined, never fudged.
- Check the midpoint, distance and angle in the breakdown.
- Follow the working panel to see the rise, run and division with your coordinates.
Slope is the first idea of calculus
In data and science, slope stops being about lines on paper and becomes a rate: kilometres per hour is the slope of a distance–time graph, a wage is the slope of earnings against hours, and a temperature trend is the slope of a climate graph. Calculus begins by asking what slope means when the graph is curved — the answer, the derivative, is the slope of the line that just touches the curve at one point. Everything on this page — rise over run, the angle, the honest treatment of the vertical case where slope fails — is the solid ground that idea stands on, and the Pythagorean Theorem Calculator covers the distance side of the story in full.