Gradient Calculator

Gradient Calculator

Calculate slope, angle, and distance between two points.

Last updated: June 2026 | By Patchworkr Team

Interactive Calculator

Results
Slope
0.75
Angle
36.869898°
Distance
5

What slope means

Slope measures how steep a line is by comparing vertical change to horizontal change.

Formula

m = (y2 - y1) / (x2 - x1) and d = sqrt((dx)^2 + (dy)^2).

Worked Example

Find the gradient between (0, 0) and (4, 3).

1. dx = 4

2. dy = 3

3. slope = 3 / 4 = 0.75

4. angle = atan2(3, 4) = 36.87 degrees

Final answer: slope 0.75, distance 5

Frequently Asked Questions

What if x1 equals x2?

The slope is undefined because the line is vertical.

Can I use negative coordinates?

Yes. Any real coordinates are allowed.

What angle is returned?

The angle is measured from the positive x-axis using atan2.

Is the distance ever negative?

No. Distance is always non-negative.

Related Tools