function NEW = transform(vertices, xa, ya, za, tx, ty, tz, sx, sy, sz)
    oness = ones(1, size(vertices,1));

    rotatex = [ 1 0 0 0;
            0 cos(xa) -sin(xa) 0;
            0 sin(xa) cos(xa) 0;
            0 0 0 1];
        
    rotatey = [ cos(ya) 0 sin(ya) 0;
            0 1 0 0;
            -sin(ya) 0 cos(ya) 0;
            0 0 0 1];
        
    rotatez = [ cos(za) -sin(za) 0 0;
            sin(za) cos(za) 0 0;
            0 0 1 0;
            0 0 0 1];
     
    translate = [ 1 0 0 tx;
                  0 1 0 ty;
                  0 0 1 tz; 
                  0 0 0 1];

    scale = [sx 0 0 0;
             0 sy 0 0;
             0 0 sz 0;
             0 0 0 1;];
              
    % Transforms can be combined with simple multiplication
    transform = rotatex * rotatey * rotatez * translate * scale;    
            
    verticesprime = [vertices oness']';
    temp = (transform * verticesprime)';
    verticesprime = temp(:, 1:3);

    NEW = verticesprime;
    

              
              
     

        
            
            