Skip to main content

Rise over run · line equation

Slope Calculator

Slope as rise over run (m = Δy/Δx), distance, angle θ, and y = mx + b from two points—or solve for a missing point from slope and distance. Logic trace and coordinate plot. Runs locally.

By Jeff Beem

Updated

Enter coordinates

Enter Point 1 (x₁, y₁) and Point 2 (x₂, y₂); Point 1 + slope + distance to solve for Point 2; Point 2 + slope + distance to solve for Point 1; or Point 1 + angle θ (uses a unit segment for the plot). Toggle °/rad for the angle field.

Unit
Results
Enter Point 1 (x₁, y₁) and Point 2 (x₂, y₂); Point 1 + Slope + Distance; or Point 1 + Angle θ to solve.

Reading results in each input mode

There are four ways to define a line: both points; Point 1 + slope + distance; Point 2 + slope + distance; or Point 1 + angle θ. The Results column shows slope, line equation, angle, and distance; Visual plot and Logic trace appear when the inputs resolve.

Worked example: (1, 3) and (4, 9)

Slope & fraction

Enter x₁=1, y₁=3, x₂=4, y₂=9 → m = 2 (6÷3). Results card shows the simplified fraction when the denominator is ≤ 100; otherwise the decimal.

Line equation

y = 2x + 1 from b = y₁ − m·x₁. Vertical lines (same x on both points) show Undefined for slope and x = k for the equation.

Angle & distance

θ ≈ 63.43° (about 0.7854 rad) and d ≈ 6.71. Copy results exports slope, equation, and distance on one line.

Visual plot & Logic trace

Plot highlights Run (Δx) in green and Rise (Δy) in amber; the segment connects P₁ and P₂. Logic trace boxes substitution steps for m, d, b, and θ.

Solve-for-point and angle modes

Point 1 + slope + distance

Fill (x₁, y₁), m, and d; leave Point 2 empty → a Point 2 (solved) card shows the coordinates at distance d along the line from Point 1.

Point 2 + slope + distance

Fill (x₂, y₂), m, and d; leave Point 1 empty → Point 1 (solved) appears. Same direction math, reversed.

Point 1 + angle θ

Enter (x₁, y₁) and θ only → slope from tan(θ), Point 2 one unit along the ray for plot/trace. Use the °/rad toggle for the angle field.

Slope Calculator: Find Slope, Distance, Angle & Line Equation

Rise over run from two points, distance, angle θ, and y = mx + b. Solve for a missing point from slope and distance. Logic trace and coordinate plot.

What This Calculator Does

This slope calculator finds slope (rise over run), distance, angle θ, and the line equation from Cartesian coordinates. Input modes: both points (x₁,y₁) and (x₂,y₂); Point 1 plus slope m and distance d (solve for Point 2); Point 2 plus m and d (solve for Point 1); or Point 1 plus angle θ (slope from tan θ, unit segment for visualization). Outputs include m as decimal and simplified fraction, y = mx + b (or x = k when slope is undefined), θ in degrees and radians, d, an SVG plot with Run and Rise highlighted, and a scrollable Logic trace. Same coordinates return no result. All math runs locally in your browser.

How the Math Works

Slope is rise over run:
m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}
Example (1, 3) and (4, 9): m = 6/3 = 2. Distance uses the Pythagorean theorem:
d=(x2x1)2+(y2y1)2d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}
Angle from the positive x-axis: θ = atan2(Δy, Δx). Y-intercept: b = y₁ − m·x₁ for non-vertical lines. Given Point 1, slope m, and distance d, the direction vector (1, m)/√(1+m²) scales by d to reach Point 2.

How to Use This Calculator

Field reference for the two-column layout:
  • Point 1 & Point 2 (x, y):
    Enter both for direct slope, distance, angle, and equation.
  • Slope (m) & Distance (d):
    Optional. With Point 1 only → solve Point 2; with Point 2 only → solve Point 1.
  • Angle (θ):
    Optional with Point 1 only. Toggle ° or rad. Sets m = tan(θ).
  • Results:
    Slope & fraction, line equation, angle & distance cards; Copy results.
  • Visual plot & Logic trace:
    Run/Rise triangle and step-by-step substitution when a line is resolved.

Slope-Intercept Form and Vertical Lines

Slope-intercept form is y = mx + b. When x₂ − x₁ = 0, slope is undefined and the equation is x = x₁. Horizontal lines (Δy = 0, Δx ≠ 0) have m = 0 and b equal to the y-coordinate.

Rise Over Run in Graphing and Grades

Slope models linear change in algebra and graphing. Rise over run also describes ramp grade and roof pitch (often as a percent). Surveying uses elevation change over horizontal distance. This tool checks homework coordinates and shows the geometry behind the formulas.

Slope Calculator FAQ

What is the slope of a line?

The slope (m) is rise over run: vertical change divided by horizontal change. m = (y₂ − y₁)/(x₂ − x₁). Positive slope rises left-to-right; negative slope falls. A horizontal line has slope 0; a vertical line has undefined slope (run = 0).

How do you find the slope between two points?

Subtract y-coordinates for rise, x-coordinates for run, then divide: m = (y₂ − y₁)/(x₂ − x₁). Example: (1, 3) and (4, 9) → m = (9 − 3)/(4 − 1) = 6/3 = 2. The Results panel shows m as a decimal and simplified fraction when the denominator is ≤ 100.

What is slope-intercept form?

y = mx + b, where m is slope and b is the y-intercept. From two points: compute m, then b = y₁ − m·x₁. Vertical lines (undefined slope) use x = k instead.

How do you find the distance between two points?

d = √[(x₂ − x₁)² + (y₂ − y₁)² (Pythagorean theorem). For (1, 3) and (4, 9): d = √(3² + 6²) = √45 ≈ 6.71. This calculator also returns angle θ and the line equation.

Can I solve for a missing point from slope and distance?

Yes. Enter Point 1 + slope + distance to find Point 2 along the line at that distance from Point 1, or Point 2 + slope + distance to find Point 1. Direction follows the unit vector (1, m) normalized by √(1 + m²). A solved-point card appears in Results.

How does the angle θ field work?

Enter Point 1 + angle θ (leave Point 2 blank). Slope becomes m = tan(θ) (vertical when cos θ ≈ 0). The tool places Point 2 one unit along the ray for the plot and trace. Toggle ° or rad next to the angle input; your choice is remembered in the browser.

What if both points are the same?

Identical coordinates (same x and same y) produce no result — rise and run are both zero, so slope is not defined. Enter two distinct points, or use Point 1 + slope + distance / angle instead.

Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

© 2026 CalcRegistry Reference Last System Check: July 2026Free Online Utility Tools