The source code

    /**
     * @ignore
     * fired when rotate using two fingers
     * @author yiminghe@gmail.com
     */
    KISSY.add('event/dom/touch/rotate', function (S, eventHandleMap, MultiTouch, Event, undefined) {
        var ROTATE_START = 'rotateStart',
            ROTATE = 'rotate',
            RAD_2_DEG = 180 / Math.PI,
            ROTATE_END = 'rotateEnd';

        function Rotate() {
        }

        S.extend(Rotate, MultiTouch, {

            onTouchMove: function (e) {
                var self = this;

                if (!self.isTracking) {
                    return;
                }

                var touches = e.touches,
                    one = touches[0],
                    two = touches[1],
                    lastAngle = self.lastAngle,
                    angle = Math.atan2(two.pageY - one.pageY,
                        two.pageX - one.pageX) * RAD_2_DEG;

                if (lastAngle !== undefined) {
                    // more smooth
                    // 5 4 3 2 1 -1 -2 -3 -4
                    // 170 180 190 200
                    var diff = Math.abs(angle - lastAngle);
                    var positiveAngle = (angle + 360) % 360;
                    var negativeAngle = (angle - 360) % 360;

                    // process '>' scenario: top -> bottom
                    if (Math.abs(positiveAngle - lastAngle) < diff) {
                        angle = positiveAngle;
                    }
                    // process '>' scenario: bottom -> top
                    else if (Math.abs(negativeAngle - lastAngle) < diff) {
                        angle = negativeAngle;
                    }
                }

                self.lastTouches = touches;
                self.lastAngle = angle;

                if (!self.isStarted) {
                    self.isStarted = true;

                    self.startAngle = angle;

                    self.target = self.getCommonTarget(e);

                    Event.fire(self.target, ROTATE_START, {
                        originalEvent: e.originalEvent,
                        touches: e.touches,
                        angle: angle,
                        rotation: 0
                    });

                } else {
                    Event.fire(self.target, ROTATE, {
                        touches: touches,
                        originalEvent: e.originalEvent,
                        angle: angle,
                        rotation: angle - self.startAngle
                    });
                }
            },

            end: function () {
                var self = this;
                self.lastAngle = undefined;
                Rotate.superclass.end.apply(self, arguments);
            },

            fireEnd: function (e) {
                var self = this;
                Event.fire(self.target, ROTATE_END, {
                    touches: self.lastTouches,
                    originalEvent: e.originalEvent
                });
            }
        });

        eventHandleMap[ROTATE] =
            eventHandleMap[ROTATE_END] =
                eventHandleMap[ROTATE_START] = new Rotate();

        return Rotate;

    }, {
        requires: ['./handle-map', './multi-touch', 'event/dom/base']
    });