Find: a metric that measures the linearity of a drift function, given only a set of (time, correction) pairs.

Given: the set D={(ti, di)} of size N+1, where ti denotes the time of the ith station, and di denotes the correction applied to that station.

Define: mi = (di+1 - di) / (ti+1 - ti)
which is clearly just the slope of the ith drift function segment.

Compute:

       N
      ---
    1 \
M = - /   m
    N ---  i
      i=1

Compute:

        N
       ---
       \       2
       /   (m )
 g     ---   i
L  =   i=0 
      -----------
             2
        N * M

which is the metric desired.

Finally, note that a linear drift function will have Lg = 1.0, and that larger values indicate increasing amounts of curvature.