how to generate 360 images by applying rotation from 1 to 360 degree on same points?

5 ビュー (過去 30 日間)
Muhammad Iqbal
Muhammad Iqbal 2020 年 2 月 12 日
回答済み: KSSV 2020 年 2 月 12 日
we try to apply loop to rotate the points from 1 degree to 360 degree :
curently we apply rotation and geneate 360 differnt images by changing the value of theta 1,2,3...360 one by one like :
theta= 45;
R=[cosd(theta) -sind(theta) 0;
sind(theta) cosd(theta) 0;
0 0 1];
points = [0 0 0;
15 0 0;
30 0 0;
45 0 0;
60 0 0;
];
rotatedPoints = points * R;
now we want to apply loop to rotate the points that generate 360 rotated images in one execution of rotation function,any sugestion will be highly appreciateable thanks

採用された回答

KSSV
KSSV 2020 年 2 月 12 日
th= 0:1:360 ;
R=@(theta) [cosd(theta) -sind(theta) 0;
sind(theta) cosd(theta) 0;
0 0 1];
points = [0 0 0;
15 0 0;
30 0 0;
45 0 0;
60 0 0;
];
h = plot(points(:,1),points(:,2)) ;
for i = 1:length(th)
rotatedPoints = points * R(th(i)) ;
set(h,'XData',rotatedPoints(:,1),'YData',rotatedPoints(:,2)) ;
drawnow
end

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by