Filter löschen
Filter löschen

Rotating array with 20 degree

4 Ansichten (letzte 30 Tage)
Abdulaziz
Abdulaziz am 17 Nov. 2013
Kommentiert: Abdulaziz am 18 Nov. 2013
Dare all,
I have two equations (2 curves) where i need to rotate the coordinate of one of them with an angle of 20 clockwise. I am wondering if there is any way to do that by rotating array matrices with 20 degree and if yes how to do this.
I appreciate your help

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 17 Nov. 2013
Bearbeitet: Azzi Abdelmalek am 17 Nov. 2013
Look at this example
% -----initial curve---------
x=1:0.01:10;
y=sin(x);
plot(x,y,'r')
hold on
%---------rotated curve-----------------------
ang=20*pi/80 % rotation angle in rad
alpha=angle(x+i*y);
k=abs(x+i*y);
new_alpha=alpha+ang;
new_v=k.*exp(j*(new_alpha));
new_x=real(new_v);
new_y=imag(new_v);
plot(new_x,new_y)
  1 Kommentar
Abdulaziz
Abdulaziz am 18 Nov. 2013
Thank you Azzi That was very helpful

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 3-D Scene Control 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!

Translated by