Matlab矩陣旋轉45度

1.函數曲線

x=linspace(-2,2);
y=x.^2;
A=[cosd(-45) -sind(-45);sind(-45) cosd(-45)]*[x;y];
figure;
plot(x,y,'r',A(1,:),A(2,:));
axis equal;
legend('原圖像','順時針旋轉45°後的圖像')

2.圖像旋轉~=矩陣旋轉

mat = [1 2 3;4 5 6;7 8 9]
mat_rotate=imrotate(huhu,45)

 

mat_rotate=imrotate(huhu,45,'crop')

3.矩陣旋轉90度、180度、270度

rot90(A);%旋轉90度
rot90(A,2)%旋轉180度
rot90(A,3)%旋轉270度

4.C/C++方法,如果有大神能看懂並用Matlab函數實現,那再好不過。

參考網址:https://blog.csdn.net/weixin_43191865/article/details/88425995

5.Java語言?如果有大神能看懂並用Matlab函數實現,那再好不過。

參考網址:https://blog.csdn.net/guominyou/article/details/79056042

對45度旋轉的行列變化有描述。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章