code: function(evt) {
          evt.preventDefault();
          evt.stopPropagation();
          if (debug) { timedLog("handleTouchRepositioning"); }
          if (evt.touches.length < 2) {
            return;
          }
          if (debug) { timedLog("handleTouchRepositioning - continued"); }
          var x1 = evt.touches[0].pageX,
            y1 = evt.touches[0].pageY,
            x2 = evt.touches[1].pageX,
            y2 = evt.touches[1].pageY,
            dx = x2 - x1,
            dy = y2 - y1,
            d = Math.sqrt(dx*dx + dy*dy),
            a = Math.atan2(dy,dx),
            da = a - transform.angle + mark.angle,
            s = d/transform.distance * mark.scale;
  
          transform.modified = true;
          positionable.handleRotationAndScale(da, s);
        }
docs: Processing coordinates for rotation/scaling