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

조회 수: 25 (최근 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?
  댓글 수: 1
KSSV
KSSV 2018년 8월 13일
Have a look on Affine transformations. You can frame your Rotation matrices and get what you want.

댓글을 달려면 로그인하십시오.

채택된 답변

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