Calculate slope, angle, and distance between two points.
Last updated: June 2026 | By Patchworkr Team
Slope measures how steep a line is by comparing vertical change to horizontal change.
m = (y2 - y1) / (x2 - x1) and d = sqrt((dx)^2 + (dy)^2).
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
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
Calculate adjoint matrix.
Find angle between vectors.
Find characteristic polynomial.
Cholesky factorization.
Expand determinant by cofactors.
Calculate cofactor matrix.