MATLAB Applying Shear to a Box
clc
clear
A(1:2,1)= [0 0];
A(1:2,2)= [0 1];
A(1:2,3)= [1 0];
A(1:2,4)= [1 1];
for i=1:4;
x(i)=A(1,i);
y(i)=A(2,i);
end
T=[1 0; 3 1];
for i=1:4;
AA(1:2,i)=T*A(1:2,i);
xx(i)=AA(1,i);
yy(i)=AA(2,i);
end
v1=[x(1) x(2)];
v2=[y(1) y(2)];
v3=[x(2) x(4)];
v4=[y(2) y(4)];
v5=[x(3) x(4)];
v6=[y(3) y(4)];
v7=[x(1) x(3)];
v8=[y(1) y(3)];
f1=line(v1,v2);
f2=line(v3,v4);
f3=line(v5,v6);
f4=line(v7,v8);
hold on
plot(x,y,'r*')
vv1=[xx(1) xx(2)];
vv2=[yy(1) yy(2)];
vv3=[xx(2) xx(4)];
vv4=[yy(2) yy(4)];
vv5=[xx(3) xx(4)];
vv6=[yy(3) yy(4)];
vv7=[xx(1) xx(3)];
vv8=[yy(1) yy(3)];
ff1=line(vv1,vv2);
ff2=line(vv3,vv4);
ff3=line(vv5,vv6);
ff4=line(vv7,vv8);
plot(xx,yy,'r*')
grid on
axis equal
title('Shear Box')
xlabel('x')
ylabel('y')
clear
A(1:2,1)= [0 0];
A(1:2,2)= [0 1];
A(1:2,3)= [1 0];
A(1:2,4)= [1 1];
for i=1:4;
x(i)=A(1,i);
y(i)=A(2,i);
end
T=[1 0; 3 1];
for i=1:4;
AA(1:2,i)=T*A(1:2,i);
xx(i)=AA(1,i);
yy(i)=AA(2,i);
end
v1=[x(1) x(2)];
v2=[y(1) y(2)];
v3=[x(2) x(4)];
v4=[y(2) y(4)];
v5=[x(3) x(4)];
v6=[y(3) y(4)];
v7=[x(1) x(3)];
v8=[y(1) y(3)];
f1=line(v1,v2);
f2=line(v3,v4);
f3=line(v5,v6);
f4=line(v7,v8);
hold on
plot(x,y,'r*')
vv1=[xx(1) xx(2)];
vv2=[yy(1) yy(2)];
vv3=[xx(2) xx(4)];
vv4=[yy(2) yy(4)];
vv5=[xx(3) xx(4)];
vv6=[yy(3) yy(4)];
vv7=[xx(1) xx(3)];
vv8=[yy(1) yy(3)];
ff1=line(vv1,vv2);
ff2=line(vv3,vv4);
ff3=line(vv5,vv6);
ff4=line(vv7,vv8);
plot(xx,yy,'r*')
grid on
axis equal
title('Shear Box')
xlabel('x')
ylabel('y')
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com