Euler angles between two 3D vectors

How do you find 3 angles of eulers between two 3D vectors? When I have one vector, and I want to get its rotation, this link can usually be used: Calculate rotations to look at a 3D point?


But how do I do this when calculating them relative to each other?

+5
source share
3 answers

As others have already pointed out, your question should be reviewed. Let me call your vectors aand b. I assume that length(a)==length(b) > 0otherwise I cannot answer the question.


cross product v = a x b; v . dot product, , cos(angle)=dot(a,b)/(length(a)length(b)), acos (@Archie ). .

- , : . Axis-Angle Euler - , . , v = [ 0, 0, 0], 0 180 .


, , , .

+9

, . .

, 1 . . 2D-: , .

, "roll < - pitch < - yaw" :

(x z) .

yaw = atan2(x, z) *180.0/PI;

, , "" . , .

float padj = sqrt(pow(x, 2) + pow(z, 2)); 
pitch = atan2(padj, y) *180.0/PI;

:

  • Roll , . 0.
  • .
  • , , .
+1

MATLAB .

A = [1.353553385,  0.200000003,  0.35]
B = [1 2 3]

[q] = vrrotvec(A,B)
Rot_mat = vrrotvec2mat(q)
-2

All Articles