Calculating the movement of points