Effacer les filtres
Effacer les filtres

How I can convert the U,V,W coordinates to its respective angles?

14 vues (au cours des 30 derniers jours)
Set Rubio
Set Rubio le 25 Août 2015
Commenté : Mohammad Abouali le 28 Août 2015
Hello, I have obtained the U,V,W coordinates of the normal vectors from a surface, using surfnorm, but i need its angles, not the coordinates, Is there some function on matlab or other method to obtain the angles corresponding to the U,V,W coordinates? Sorry for my English. Thanks in advance.

Réponse acceptée

Mohammad Abouali
Mohammad Abouali le 25 Août 2015
Modifié(e) : Mohammad Abouali le 25 Août 2015
You have to define first the angle relative to what.
Let's say you want the angle relative to x-y plane. A vector that is perpendicular to x-y plane is [0 0 1] then you can compute the angle of your vector to that plane as:
V1=[u,v,w];
V2=[0,0,1];
Angle_Rad=pi/2-acos(dot(V1,V2)./(norm(V1).*norm(V2)))
Angle_Deg=Angle_Rad*180/pi
  2 commentaires
Set Rubio
Set Rubio le 26 Août 2015
thank you very much, that code run perfectly
Mohammad Abouali
Mohammad Abouali le 28 Août 2015
You are welcome. If you are happy with the answer, would you please accept the answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by