Slope Calculator
Show the math
What Your Result Means
- Slope (m): The steepness and direction of the line. A positive slope rises left to right; a negative slope falls. A slope of 0 is a horizontal line, and "undefined" means a vertical line.
- Y-Intercept (b): The y-coordinate where the line crosses the y-axis (when x = 0). Combined with slope, it defines the line completely.
- Equation: The line in slope-intercept form (y = mx + b). For vertical lines, it shows x = constant instead.
- Distance: The straight-line (Euclidean) distance between the two points, calculated using the Pythagorean theorem.
- Angle: The angle the line makes with the positive x-axis, measured in degrees using the arctangent of the slope.
How This Calculator Works
You enter two coordinate points (x₁, y₁) and (x₂, y₂). The tool computes slope as rise over run (Δy/Δx), the y-intercept using b = y₁ − m·x₁, and writes the equation in slope-intercept form. It also calculates the Euclidean distance with the distance formula, the midpoint by averaging coordinates, and the angle via the arctangent function. Vertical lines (where x₁ = x₂) show slope as "undefined."
Quick Questions
What does it mean when the slope is undefined?
An undefined slope occurs when both points have the same x-coordinate, making the line perfectly vertical. Division by zero (Δx = 0) means the slope formula cannot produce a finite number. The equation is expressed as x = constant instead of y = mx + b.
How is slope different from angle?
Slope is the ratio of vertical change to horizontal change (rise/run), while angle measures the rotation from the positive x-axis in degrees. They are related by the formula: angle = arctan(slope). A slope of 1 corresponds to a 45° angle.
Can I use this for parallel and perpendicular lines?
Yes. Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals (m₁ × m₂ = −1). Calculate the slope here, then use it to determine parallel or perpendicular relationships.
What is the distance formula based on?
The distance formula is derived from the Pythagorean theorem: d = √((x₂−x₁)² + (y₂−y₁)²). It calculates the length of the hypotenuse of a right triangle formed by the horizontal and vertical differences between the two points.
Sources
- Wikipedia — Slope (definition, formulas, and geometric interpretation)
- Wikipedia — Euclidean Distance (distance formula derivation)
- Khan Academy — Linear Equations and Graphs (slope-intercept form tutorial)
Method & review
Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.