Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Visualize Rotation in 3d | MATLAB


Code:

clc
clear all
close all
warning off
t=0:0.01:20*pi;
x=t.*cos(t);
y=t.*sin(t);
plot3(x,y,t);
axis([-80 80 -60 60 0 70]);
clf;
for i=1:1000
 clf
m=[x;y;t];
a=1;
rot=[cos(a) -sin(a) 0;sin(a) cos(a) 0;0 0 1];
s=rot*m;
x=s(1,:);
y=s(2,:);
t=s(3,:);
plot3(x,y,t);
axis([-100 100 -100 100 0 70]);
pause(1);
end



No comments

Popular Posts