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度旋转的行列变化有描述。

 

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