ToolPony.comDocumentation

Slope calculator

Find a slope and intercepts from two points, or find both endpoints at a given distance.

Get started

  1. Use the example values or enter your own measurements.
  2. Calculate, then copy the result or download the available details.

Example

Input

(0, 0) to (3, 4)

Expected result

Slope 4/3 and distance 5

Try it

Good to know

The calculation runs in your browser. Use consistent units in fields with no explicit unit.

Calculation method

The slope is the rise divided by the run. A vertical line has an undefined slope. A known distance and direction determine two endpoints on opposite sides of the starting point.

m=y2−y1x2−x1,θ=arctan⁡(m),y=mx+bm=\frac{y_2-y_1}{x_2-x_1},\qquad \theta=\arctan(m),\qquad y=mx+b

The two-point mode reports vertical and horizontal changes separately. Use the sign of each change to tell which direction the point moved. A vertical line has a constant x-coordinate.

A line and a distance determine a point on each side of the starting point. Use the endpoint table to keep both solutions.

Calculation mode

Two points
  • X1
  • Y1
  • X2
  • Y2
Point and direction
  • X1
  • Y1
  • Distance
  • Direction given as · Slope / Angle in degrees
  • Direction value