Calculating exponential moving averages
This is border line a bad question, as not enough code is given to properly review it.

The variables a -> g look terrible, I would create an array with the numbers you need:

var dataPoints = [1.16,1.19,1.22,1.26,1.30,1.35,1.40];


Then I would would loop over those points and create an averages object

var averages = {},
    value, x;
for(var i = 0, length = dataPoints.length ; i &lt; length ; i++ ){
  value = dataPoints[i];
  x = Math.pow(value, -(time-lastTime));
  averages[value] = x * lastAverages[value] + (1-x) * distance;
}


I cannot tell whether the math is correct, if it is not correct, then this question does not belong here :)