如何創建旋轉45度的2x2旋轉矩陣? 我研究過,但我發現的是我在我的代碼中使用的,它給出了3x3矩陣!2x2旋轉矩陣(45度)
clear;
clc;
[email protected](t) sqrt(t).*cos(4.*t);
num_of_samples = 20 ;
figure;
fplot(y, [0,2*pi])
hold on
tSample = linspace (0, 2*pi, num_of_samples);
ySample = zeros(1,num_of_samples);
for i=1:num_of_samples
temp = tSample(i);
temp_2 = sqrt(temp);
ySample(i) = temp_2*cos(4*temp);
end
mXY=([tSample;ySample]);
fplot(y,[0,2*pi]);
hold on;
plot(mXY(1,:),mXY(2,:),'Xk');
hold on;
plot(mXY(1:10:end),mXY(2:10:end),'Xr');
%rotation matrix
R=rotx(45);
mXYrot=mXY.*R;
真的嗎? 'R2d = @(deg)[cosd(deg)-sind(deg); sind(deg)cosd(deg)];' – horchler