0functioncalculatePinchDirection(){if(pinchZoom<1){returnOUT;}else{returnIN;}}/***Calculatethelength/distanceoftheswipe*@param{point}startPointApointobjectcontainingxandyco-ordinates*@param{point}endPointApointobjectcontainingxandyco-ordinates*@returnint*@inner*/functioncalculateDistance(startPoint,endPoint){returnMath.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2) Math.pow(endPoint.y-startPoint.y,2)));}/***Calculatetheangleoftheswipe*@param{point}startPointApointobjectcontainingxandyco-ordinates*@param{point}endPointApointobjectcontainingxandyco-ordinates*@returnint*@inner*/functioncalculateAngle(startPoint,endPoint){varx=startPoint.x-endPoint.x;vary=endPoint.y-startPoint.y;varr=Math.atan2(y,x);//radiansvarangle=Math.round(r*180/Math.PI);//degrees//ensurevalueispositiveif(angle<0){angle=360-Math.abs(angle);}returnangle;}/***Calculatethedirectionoftheswipe*ThiswillalsocallcalculateAngletogetthelatestangleofswipe*@param{point}startPointApointobjectcontainingxandyco-ordinates*@param{point}endPointApointobjectcontainingxandyco-ordinates*@returnstringEither{@link$.fn.swipe.directions.LEFT}/{@link$.fn.swipe.directions.RIGHT}/{@link$.fn.swipe.directions.DOWN}/{@link$.fn.swipe.directions.UP}*@see$.fn.swipe.directions*@inner*/functioncalculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint)){returnNONE;}varangle=calculateAngle(startPoint,endPoint);if((angle<=45)