angleBetweenTwoVector = function( axis, vec1, vec2 ) {
            var vecLen1 = vectorLength( vec1 );
            var vecLen2 = vectorLength( vec2 );

            if ( !vecLen1 || !vecLen2 ) {
                return 0;
            }

            var cos = vectorDotProd( vec1, vec2 ) / vecLen1 / vecLen2 ;
            var angle = Math.acos( cos ) * 180 / Math.PI;

            if ( tripleProduct( vec1, vec2, axis ) > 0 ) {
                return angle;
            } else {
                return -angle;
            }
        }
Return the angle between two vector.

The axis is used to determine the rotation direction.