I have no experience with UTM coordinates and whether you're dealing with geometry on a curved surface, but if as you state, it's simple rectangle geometry, then any 3 points of that rectangle define a right-angled triangle.
% Choose any 3 points of the rectangle
p1 = [80 20];
p2 = [30 40];
p3 = [30 20];
% Make vectors along each edge of the triangle
v12 = p2-p1;
v13 = p3-p1;
v23 = p3-p2;
% Normalise those vectors
u12 = v12/norm(v12);
u13 = v13/norm(v13);
u23 = v23/norm(v23);
% Compute angles as the acos of their dot products
angle1 = acos(dot(u12, u13, 2));
angle2 = acos(dot(u23, -u12, 2));
angle3 = pi - angle1 - angle2;
% Display
figure, plot(p1(1),p1(2),'b.',p2(1),p2(2),'g.',p3(1),p3(2),'m.'), axis equal, hold on
text(p1(1),p1(2),sprintf('Pt1 (%d deg)',round(angle1/pi*180)))
text(p2(1),p2(2),sprintf('Pt2 (%d deg)',round(angle2/pi*180)))
text(p3(1),p3(2),sprintf('Pt3 (%d deg)',round(angle3/pi*180)))