On the Android, without using a framework like Sencha or JQTouch or JQMobile, but using jQuery (regular jQuery), I want to detect a Cancel/Back Swipe (swiping left to right). I have something accomplished so far, but I'm trying to determine the math formula to implement in jQuery such that I capture a left to right swipe event, and not another kind of gesture. What do you suggest? I imagine I need some kind of acceptable variance. I'm assuming there's some sort of calculus formula that could get reapplied here, but unfortunately I shied away from calculus in college. So, your answer will educate me, hopefully.

Here's some sample x,y start/finish data to play with:

(a) Swiping diagonally from middle left to upper right (an undesirable gesture in this case)

21,269 - 278,85

(b) Swiping diagonally from middle left to lower right (an undesirable gesture in this case)

13,269 - 331,436

(c) Swiping straight (sort of) from middle left to middle right (a desirable gesture)

34,267 - 326,266

or

36,494 - 355,479

```
var gnStartX = 0;
var gnStartY = 0;
var gnEndX = 0;
var gnEndY = 0;

window.addEventListener('touchstart',function(event) {
  gnStartX = event.touches[0].pageX;
  gnStartY = event.touches[0].pageY;
},false);

window.addEventListener('touchmove',function(event) {
  gnEndX = event.touches[0].pageX;
  gnEndY = event.touches[0].pageY;
},false);

window.addEventListener('touchend',function(event) {
  alert('START (' + gnStartX + ', ' + gnStartY + ')   END (' + gnEndX + ', ' + gnEndY + ')');
},false);

```