Answer by
cubedbee (155)
In three dimensions, if the starting position is (X1, Y1, Z1) and the ending position is (X2, Y2, Z2) then the distance traveled is square root of [(X1-X2)^2 + (Y1-Y2)^2 + (Z1-Z2)^2]. If your problem is only in two dimensions, then Z1 and Z2 can both be set to equal 0 and this same equation will work.