What should I do if I want to rotate a line?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Donghui Sun
am 23 Okt. 2013
Beantwortet: Friedrich
am 23 Okt. 2013
For example, we have line : y = 2*x; I want to rotate the line by 30 degrees in a counterclockwise direction.
What should I do ? Any suggestions?
1 Kommentar
Akzeptierte Antwort
Friedrich
am 23 Okt. 2013
Hi,
f = @(x) 2*x;
x = 0:0.1:10;
angl = 90;
rot_mat = @(angl) [cos(angl) -sin(angl); sin(angl) cos(angl)];
mat = rot_mat(deg2rad(angl));
f_rot = mat*[x;x*2];
plot(x,f(x),f_rot(1,:),f_rot(2,:));
legend('original','rotated')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Point Cloud Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!