function pinch_distance(e) {

        var touch_a = e.touches[0];
        var touch_b = e.touches[1];

        var delta_x = touch_a.clientX - touch_b.clientX;
        var delta_y = touch_a.clientY - touch_b.clientY;

        return Math.sqrt(delta_x*delta_x + delta_y*delta_y);

    }
Given a touch event, calculates the distance between the first two
touches in pixels.

@param {TouchEvent} e The touch event to use when performing distance
                      calculation.
@return {Number} The distance in pixels between the first two touches.