react-swipeable-views
react-swipeable-views copied to clipboard
Question: method to detect quick move movement on the source code
I could't understand the code this.vx = this.vx * 0.5 + (touch.pageX - this.lastX) * 0.5;
on https://github.com/oliviertassinari/react-swipeable-views/blob/master/packages/react-swipeable-views/src/SwipeableViews.js#L452.
And is (lastY - firstY) / (endTime - startTime)
to caculate speed OK?
Thank you very much if you can explain it to me.