how to rotate coordiante system about Z axis first then rotate about about the new Y axis.

26 次查看(过去 30 天)
Assume two coordinate systems, one is the global coordinate system(XYZ) and another is a local coordinate system which is obtained by rotating about the Z axis of the global coordinate system and then rotating about the new Y axis. how can I get the translated matrix of this process?

采纳的回答

David Goodmanson
David Goodmanson 2018-8-19
Hi Yang,
Suppose you have rotation matrices
Rx = [1 0 0 Ry = [c 0 -s Rz = [c -s 0
0 c -s 0 1 0 s c 0
0 s c] s 0 c] 0 0 1]
If p is the column vector [x;y;z], then for example pnew = Rx*p.
Here s is sin(theta), c = cos(theta), these are active rotations of the object, and looking down the axis of rotation toward the origin, the rotations are counterclockwise.
A rotation in z and then in the original y would be
vnew = Ry*Rz*v
A rotation in z and then in the new y is
vnew = Rz*Ry*v
which has the order reversed. That's because a rotation about the new y axis is equivalent to: rotate the new y axis back to the old y axis, then rotate about the old y axis, then rotate forward so that the old y axis is the new y axis.
Ry_new = Rz*Ry*Rz^(-1)
so
Ry_new*Rz = Rz*Ry*Rz^(-1)*Rz = Rz*Ry
  6 个评论
James Tursa
James Tursa 2019-1-28
编辑:James Tursa 2019-1-28
@David: You have a mixed set of rotation matrices because the sine signs are not consistent. The sine signs of the Ry rotation should be reversed when compared to the others to make the set consistent. E.g.,
Rx = [1 0 0 Ry = [c 0 s Rz = [c -s 0
0 c -s 0 1 0 s c 0
0 s c] -s 0 c] 0 0 1]
See this link "In three dimensions":
David Goodmanson
David Goodmanson 2019-6-28
Hi James, thanks for pointing this out. I blithely borrowed the first ones from a set I made having to do with the earth's rotation, but for the problem here the consistent set would have been better.

请先登录,再进行评论。

更多回答(1 个)

Yang Lu
Yang Lu 2019-1-28
Ry_new = Rz*Ry*Rz^(-1)
so
Ry_new*Rz = Rz*Ry*Rz^(-1)*Rz = Rz*Ry
Hi David,
Regarding to the Ry_new, I do not understand why do you multiply Rz^(-1). In my opinion, the new Ry can be obtained by rotating the Ry around the Z-axis.
Thank you!
Yang.
  5 个评论
Yang Lu
Yang Lu 2019-1-28
if rotate around the global Y, the Rnew = Ry*Rz and if rotate around the local Y, the Rnew is Rnew = Rz*Ry.
David Goodmanson
David Goodmanson 2019-1-29
OK, to, start with, a vector has one index so it is going to transform like
vnew(i) = Sum{j} A(i,j)v(j)
for some A.
A matrix has two indices so under the usual assumptions involving transformations it is going to transform like
Mnew(i,j) = Sum{k,q} A(i,k)B(j,q)M(k,q)
for some A and B. WIth matrix multiplication convention you arrive at, for example
Rnew = Rz*R*Rz^(-1).
That's one argument.
Now suppose there is an arbitrary rotation about the x axis and a 90 degree rotation about the z axis:
Rx = [1 0 0;
0 c -s;
0 s c]
Rz = [0 -1 0;
1 0 0;
0 0 1]
Without getting entrapped in all the details, since the 90 deg z rotation swaps x and y (with a sign involved), using these two rotations one should be able to convert an x rotation into a y rotation.
However, doing what you propose,
Rz*Rx = [0 -c s;
1 0 0;
0 s c]
which is an orthogonal matrix as it must be, but not a useful rotation matrix. On the other hand if you work out Rz*Rrx*Rz^(-1) the result is
Rz*Rx*Rz^(-1) = [ c 0 s; = Ry
0 1 0
-s 0 c]
a

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by