function [U] = unrotateDOF(numnp,U,nangle)
% rotates degrees of freedom in local coordinates to global coordinates

% for each node, rotate backwards by that node's angle
for i=1:numnp
  teta=nangle(i);
  s1=  U(2*i-1)*cos(teta)-U(2*i)*sin(teta);
  s2=  U(2*i-1)*sin(teta)+U(2*i)*cos(teta);

  U(2*i-1) = s1;
  U(2*i)   = s2;
end
