function calculateAngle(startPoint, endPoint) {
      var x = startPoint.x - endPoint.x;
      var y = endPoint.y - startPoint.y;
      var r = Math.atan2(y, x); //radians
      var angle = Math.round(r * 180 / Math.PI); //degrees

      //ensure value is positive
      if (angle < 0) {
        angle = 360 - Math.abs(angle);
      }

      return angle;
    }
Calculate the angle of the swipe
@param {point} startPoint A point object containing x and y co-ordinates
@param {point} endPoint A point object containing x and y co-ordinates
@return int
@inner