function d = distanceTravelled(g,r)
d = g.*r;
