Gradient Calculation from fitting a plane to as many as thirty points
a x1 + b y1 + c = h1
a x2 + b y2 + c = h2
a x3 + b y3 + c = h3
. . .
a x30 + b y30 + c = h30
where (xi,yi) are the coordinates of the well and
hi is the head
i = 1,2,3, ... , 30
The coefficients a, b, and c are calculated by a least-squares fitting of the the data to a plane
The gradient is calculated from the square root of (a2 + b2) and the angle from the arctangent of a/b or b/a depending on the quadrant |