How this calculator works
Gradient compares vertical change with horizontal change. A positive value rises as x increases and a negative value falls. This page concentrates on recovering line measurements and coordinates from a known gradient, including an inverse run calculation. The reported inclination is the principal line angle between -90 and 90 degrees, with signed vertical endpoints. Segment-direction input can describe a displacement in any quadrant. Gradient is omitted for an exactly zero run.
Formula
g = rise/run = (y2-y1)/(x2-x1). rise = g run; run = rise/g; segment length = hypot(run,rise); inclination = atan(g).
Worked example
From (0,1) to (4,4), the rise is 3 and the run is 4. The gradient is 0.75, the length is 5 and the inclination is about 36.869898 degrees. Replacing the rise with -3 gives gradient -0.75.
Advertisement
Frequently asked questions
Is this the gradient of a multivariable function?
No. Here gradient means the slope of a straight line in two-dimensional coordinate geometry.
What units does a gradient have?
It has y units per x unit. It is dimensionless only when the two axes use the same kind of measurement and unit.
Why is the vertical gradient missing?
Its run is zero, so the ratio is undefined. The classification and inclination still describe the line.
Can a zero gradient recover a missing x?
No. A horizontal line has the same y at every x, so a y difference does not identify a unique x coordinate.