Rotating X & Y Data
41 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
I am trying to rotate GPS data, that has been con verted into X & Y coordintes to dsplay lengthwy along the Y axis strting at 0,0
I'm trying to rotate data in a 6135 x 15 table, where the data is layed out as follows 6135 data points of coordintes seperted into X & yXcolumns for each person.
Time I Person 1 x I Person 1 y I Person 2 x I Person 2 y I Person 3 x I Person 3 y .....etc
I would like to rotate this date to run length way along the Y axis. Each line represents data for a different person (7 in total):
Is there a way to rotate a large table of X & Y coordinates.
Thank you in advance for your help!
0 commentaires
Réponse acceptée
Plus de réponses (1)
KSSV
le 20 Sep 2022
p1 = rand(2,1) ;
p2 = rand(2,1) ;
%%rotation matrix
th = 90*pi/180 ;
R = [cos(th) -sin(th) ;sin(th) cos(th)] ;
%%rotate points
pr2 = R*p2 ;
figure
hold on
plot([p1(1) p2(1)],[p1(2) p2(2)] ,'r') ;
plot([p1(1) pr2(1)],[p1(2) pr2(2)] ,'b') ;
5 commentaires
Voir également
Catégories
En savoir plus sur Sensor Models dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!