I have a particle which is hopping between positions in 3D space
hops = {{1, 1, 1}, {2, 2, 2}, {1, 1, 1}, {2, 2, 2}} I wish to calculate the the total distance hopped.
Is there a good way to do this?
At the moment I have a for loop storing the total, which adds the differences like this
total = 0; For[i = 1, i <= 3, i++ , temp = EuclideanDistance[hops[[i]], hops[[i + 1]]]; total = total + temp ; ]; But, I wonder if I could do this better.