π Slope, Distance & Midpoint Calculator
Two points in, slope, distance, midpoint, and line equation out.
Slope (m)
How to Use the Calculator
Enter the coordinates of two points. You will get the slope, the distance between them, the midpoint, and the equation of the line through them, each with the formula working shown.
Enter point 1 (x1, y1) and point 2 (x2, y2).
Read the slope, distance, and midpoint with substituted formulas.
Copy the line equation in slope-intercept form for your work.
The Three Formulas
Slope: m = (y2 β y1)/(x2 β x1). Rise over run. Distance: d = β((x2βx1)Β² + (y2βy1)Β²), Pythagoras on the grid. Midpoint: ((x1+x2)/2, (y1+y2)/2), the average point. Together they fully describe the segment: slope gives direction, distance gives length, midpoint gives center.
From Two Points to a Line Equation
With slope m and point (x1, y1), point-slope form gives y β y1 = m(x β x1). Distribute and solve for y to reach slope-intercept form y = mx + b, where b is the y-intercept. Example: points (1,2) and (5,6) give m = 1, so y β 2 = 1(x β 1), hence y = x + 1. Two special cases: horizontal lines (y1 = y2) have m = 0 and equation y = y1; vertical lines (x1 = x2) have undefined slope and equation x = x1.
Reading Slope Like a Story
Slope is a rate of change. In a distance-time graph, slope is speed. In a cost graph, slope is price per unit. Steeper means faster change; the sign tells you whether the quantity grows or shrinks. Parallel lines share slopes; perpendicular slopes are negative reciprocals (m and β1/m). If you can read slope, you can read any linear relationship in science, economics, or everyday data.
Frequently Asked Questions
What is the slope formula?
Slope m = (y2 β y1) / (x2 β x1): rise over run. It measures steepness and direction. Positive slope rises left to right, negative falls, zero is horizontal, and undefined (division by zero) is vertical. A slope of 2 means y rises 2 units for every 1 unit of x.
What is the distance formula?
Distance = β((x2βx1)Β² + (y2βy1)Β²). It is the Pythagorean theorem applied to the coordinate grid: the differences in x and y are the legs, the segment between points is the hypotenuse. This tool shows the substitution and simplification.
What is the midpoint formula?
Midpoint = ((x1+x2)/2, (y1+y2)/2): simply average the x-coordinates and average the y-coordinates. It gives the exact center of the segment. Useful for bisecting lines, finding centers of shapes, and splitting distances fairly.
How do I get the line equation from two points?
First compute the slope m. Then use point-slope form: y β y1 = m(x β x1), and rearrange to slope-intercept form y = mx + b. This calculator does the algebra and shows the final equation. For vertical lines (x1 = x2), the equation is simply x = x1.
What does undefined slope mean?
A vertical line has undefined slope because run = 0 and division by zero is impossible. It is not zero slope: zero slope is a flat horizontal line. The calculator detects vertical lines and reports the equation as x = constant instead of forcing a slope.