Question
function spheremap clear all r=1; x1=zeros(81,81); x2=zeros(81,81); x3=zeros(81,81); c=zeros(81,81); x1new=zeros(81,81); x2new=zeros(81,81); x3new=zeros(81,81); for i=1:1:81 theta=(i-1)*2*pi/80; for j=1:1:81 phi=(j-1)*pi/80; x1(i,j)=r*cos(theta)*sin(phi); x2(i,j)=r*sin(theta)*sin(phi); x3(i,j)=r*cos(phi); hold on end end
function spheremap
clear all
r=1;
x1=zeros(81,81);
x2=zeros(81,81);
x3=zeros(81,81);
c=zeros(81,81);
x1new=zeros(81,81);
x2new=zeros(81,81);
x3new=zeros(81,81);
for i=1:1:81
theta=(i-1)*2*pi/80;
for j=1:1:81
phi=(j-1)*pi/80;
x1(i,j)=r*cos(theta)*sin(phi);
x2(i,j)=r*sin(theta)*sin(phi);
x3(i,j)=r*cos(phi);
hold on
end
end
surf(x1,x2,x3,'EdgeColor','c')
colormap winter
view (3)
A = [1 0 0; 0 1 0;0 0 1];
A = [1 2 0; 2 1 0;0 0 1];
A = [1 0 2; 0 1 0;2 0 1];
A = [1 0 0; 0 1 2;0 2 1];
A = [1 2 2; 2 1 2;2 2 1];
A = [1 0 0; 0 1 1;0 1 1];
A = [2 2 2; 2 2 2;2 2 2];
A = [2 2 2; 2 2 2;2 2 1];
A = [2.7 2 2; 2 2.7 2;2 2 1];
A = [2.7 2 2; 2 2.7 .2;.2 .2 1];
lambda=eig(A)
[V,D]=eig(A)
for i=1:1:81
theta=(i-1)*2*pi/80;
for j=1:1:81
phi=(j-1)*pi/80;
x1=r*cos(theta)*sin(phi);
x2=r*sin(theta)*sin(phi);
x3=r*cos(phi);
B=[x1;x2;x3];
X=A*B;
x1new(i,j)=X(1);
x2new(i,j)=X(2);
x3new(i,j)=X(3);
hold on
end
end
surf(x1new,x2new,x3new,'EdgeColor','none')
camlight('headlight')
axis equal
grid on
grid minor
title('Stretch Transform')
set(gca,'fontsize',12)
xlabel('x')
ylabel('y')
zlabel('z')
axis([-4 4 -4 4 -4 4])
hold off;
drawnow
F(j) = getframe;
end
Make a movie in MATLAB. There are 10 transforms. Make a movie that varies any entry in the transform matrix in a manner that causes the transform to "spin" about any single rotation axis (not necessarily x, y, or z)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started