Effacer les filtres
Effacer les filtres

Problems with angles between two 3D vector!

1 vue (au cours des 30 derniers jours)
Gabriella Tartaglia
Gabriella Tartaglia le 30 Mai 2019
Hi everybody!
I'm analysing data coming from an optoelectronic system which records body movements. I record positions of markers during time and I have to calculate angles like shoulder rotation, elbow flexion/extension, ecc. I'm able to do this using this formula:
ThetaInDegrees = atan2d(norm(cross(u,v)),dot(u,v));
where u and v are two 3D vectors. The movement that I perform is like a sinewave so it goes up and then down several times.
The problem is that sometimes(I don't understand well when) the atan2d formula gives me only crescent values of angles and it seems like the sinewave is rectified, as in the picture below:
How can I manage this problem in order to have a normal sinusoid??
Thanks so much!!
  2 commentaires
Jan
Jan le 31 Mai 2019
Without seeing your input data and known, what you exactly expect, all I want to mention is that atan2d works exactly as expected. So if there is a problem, it must be found in your 3D model or in the import of the data.
Think twice: With seeing the code line for a trigonometric formula only, it is impossible to estimate, why the results differ from your expectations.
Gabriella Tartaglia
Gabriella Tartaglia le 31 Mai 2019
Sorry.
My code is:
for i= 2:length(data_res)
FA_inst = [(Elbow2(i,1)-Cent_wrist(i,1)) (Elbow2(i,2)-Cent_wrist(i,2)) (Elbow2(i,3)-Cent_wrist(i,3))];
hand_inst = [(Index(i,1)-Med_wrist(i,1)) (Index(i,2)-Med_wrist(i,2)) (Index(i,3)-Med_wrist(i,3))];
wrist_flexo_extention_angle(i) = 180- atan2d(norm(cross(FA_inst, hand_inst)),dot(FA_inst, hand_inst));
end
where FA_inst is the instantaneus vector that identifis the forearm while hand_inst is the vector that identify the hand. The wrist flexio/extension is the angle I need.
I wolud like that, as it is indicated in the figure below:
wrist.JPG
when the hand bends in the sense of the blue arrow the angle measured is positive, while when it goes towards the red arrow's direction, the measured angle is negative.
It is possible with some other formulas?
Thanks so much Jan!!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming 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!

Translated by