How does touchmove calculate the distance of movement instead of displacement?

the sliding distance of the mobile phone needs to be calculated in the

project.
the usual way to calculate the distance is to use the coordinates of touchend minus the coordinates of touchstart and then calculate.

suppose that the finger moves from point A to point B and then back to point A, the coordinates of touchend coincide with that of touchstart, and the actual sliding distance of the finger is twice the length of AB. At this time, how to calculate the distance of finger sliding?

Mar.16,2021

every time you execute touchmove, calculate the distance between this time and the last time you executed touchmove or touchstart. Add up these distances, and it seems that you can only do so

.
Menu