About the slope, distance and midpoint calculator
Enter two points to get the straight-line distance d = √((x₂ − x₁)² + (y₂ − y₁)²), the midpoint ((x₁ + x₂)/2, (y₁ + y₂)/2) and the slope m = (y₂ − y₁)/(x₂ − x₁). The line through them is written in slope-intercept form y = mx + b, in standard form Ax + By = C with whole-number coefficients and in point-slope form, alongside its perpendicular bisector. Fractions stay exact, so a slope of 4/3 is not rounded to 1.3333.
The default points (1, 2) and (4, 6) are 5 apart, a 3-4-5 triangle, with midpoint (2.5, 4) and line y = (4/3)x + 2/3. Switching on a second line adds whether the two are parallel, perpendicular or intersecting, the angle between them and the crossing point.
A vertical line has no slope, so only its standard form, such as x = 3, is given. Coordinates carry no unit: the distance is in whatever unit they use.
Questions
How do you find the slope between two points?
Divide the change in y by the change in x: m = (y₂ − y₁)/(x₂ − x₁). From (1, 2) to (4, 6) the rise is 4 and the run is 3, so m = 4/3 ≈ 1.3333. A positive slope rises to the right, a negative one falls, 0 is horizontal, and when x₂ = x₁ the line is vertical and the slope is undefined.
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²), which is Pythagoras' theorem applied to the horizontal and vertical gaps. Between (1, 2) and (4, 6) the gaps are 3 and 4, so d = √25 = 5. For points given as latitude and longitude use a great-circle formula instead, because the flat formula ignores the Earth's curvature.
How do you find the equation of a line through two points?
Find the slope m, then the intercept b = y₁ − m·x₁, and write y = mx + b. Through (1, 2) and (4, 6), m = 4/3 and b = 2 − 4/3 = 2/3, so y = (4/3)x + 2/3. Multiplying by 3 and rearranging gives the standard form 4x − 3y = −2, with whole-number coefficients.
How do you tell if two lines are parallel or perpendicular?
Compare their slopes. Parallel lines have equal slopes, and perpendicular lines have slopes whose product is −1, such as 1/2 and −2. Any other pair crosses at an angle θ with tan θ = |(m₂ − m₁)/(1 + m₁m₂)|: slopes of 4/3 and −1 give tan θ = 7, so the lines meet at 81.87°.
What is a perpendicular bisector?
The line through the midpoint of a segment at right angles to it; every point on it is equally far from both endpoints. For (1, 2) and (4, 6) it passes through (2.5, 4) with slope −3/4, the negative reciprocal of 4/3, giving y = −0.75x + 5.875. The bisectors of a triangle's three sides meet at the centre of its circumscribed circle.
How accurate is the slope, distance and midpoint calculator?
Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 6 worked examples whose answers come from independent sources; for example, “P₁(1, 2) and P₂(4, 6)” is checked against Python 3.8 fractions: dx = 3, dy = 4 (3-4-5), m = 4/3, b = 2 − 4/3 = 2/3; bisector through (5/2, 4) with slope −3/4 has b = 47/8 = 5.875 (terminating fractions print as decimals); math.degrees(atan(4/3)).
Where does the method come from?
OpenStax College Algebra 2e, §2.1 (distance and midpoint formulas) and §2.2 (equations of lines); Weisstein, E. W. “Line”, “Perpendicular Bisector” — MathWorld.