What is the formula for gradient in geography?

GRADIENT. Gradient = vertical difference in elevation / horizontal distance.

How is gradient calculated?

To calculate the gradient of a straight line we choose two points on the line itself. The difference in height (y co-ordinates) รท The difference in width (x co-ordinates). If the answer is a positive value then the line is uphill in direction.