Maneira mais simples de fazer rotação com dois dedos no Android

private MotionEvent mLastMultitouchEvent = null;

if (mLastMultitouchEvent == null) {
mLastMultitouchEvent
= MotionEvent.obtain(event);
} else {
float currentRotation = rotation(event);
float prevRotation = rotation(mLastMultitouchEvent);
CGPoint rotationFocus = midpoint(event);
mGestureListener
.onRotate(event, mLastMultitouchEvent, currentRotation - prevRotation, rotationFocus);
mLastMultitouchEvent
= MotionEvent.obtain(event);
}

private float rotation(final MotionEvent event) {
double deltaX = (event.getX(0) - event.getX(1));
double deltaY = (event.getY(0) - event.getY(1));
double radians = Math.atan2(deltaY, deltaX);
return (float) Math.toDegrees(radians);
}

private CGPoint midpoint(final MotionEvent event) {
double x = (event.getX(0) + event.getX(1)) / 2.0;
double y = (event.getY(0) + event.getY(1)) / 2.0;
return CGPoint.make((float) x, (float) y);
}