rotateAround = function( pos, rotationData, reverse )
{
    if( typeof( reverse ) === "undefined" )
        reverse = 1;
    else if( reverse == true ) 
        reverse = -1;
    else
        reverse = 1;
    
    var x = pos[ 0 ];
    var y = pos[ 1 ];
    
    var rot = -1 * reverse * rotationData.theta * Math.PI / 180.0;
    var cx = rotationData.x;
    var cy = rotationData.y;
    
    var c = Math.cos( rot );
    var s = Math.sin( rot );
    
    var posrx = c * x - s * y + ( -cx * c + cx + cy * s );
    var posry = s * x + c * y + ( -cx * s - cy * c + cy );
    
    return [ posrx, posry ];
}
