coordinate system rotation and then calculate position in new (rotated) system
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a direction defined by azimuth and evation (e.g. Azi, Elev).
I would like to calculate values of these Azi i Elev after coordinate system
rotation: first around Z axis (angle e.g.: Zrot) and then around rotated (in first rotation
around Z axis) Y axis (angle e.g.: Yrot).
So: I rotate coordinate system around Z axis, then around "rotated" Y axis and I would like to
calculate Azi and Elev in rotated coordinate system.
I try
vrot = v*Rz*Ry
with
Rz = [ cosd(Azi) -sind(Azi) 0;
sind(Azi) cosd(Azi) 0;
0 0 1];
Ry = [ cosd(Elev) 0 sind(Elev);
0 1 0;
-sind(Elev) 0 cosd(Elev)];
But it seems that in this approach after first rotation (around Zo axis) we get new position in Old Coordinate System (POZo turns into POZn) and this new position (POZn) is then rotated around Yn axis.
But my goal is a bit different: I would like rotate XoYoZo system around Zo axis, get POZo in New Coordinate System (POZo in XnYnZn) and finally rotate XnYnZn system around Yn axis and obtain POZo after this rotation.
If it can be done somehow in matlab?
댓글 수: 0
답변 (1개)
darova
2020년 3월 16일
Here is the solution
v1 = Rz*v(:);
[az1,el1] = cart2sph(v1(1),v1(2),v1(3));
v2 = Ry*v1(:);
[az2,el2] = cart2sph(v2(1),v2(2),v2(3));
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Coordinate Systems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!