Rotation of Z Axis

2 views (last 30 days)
Sven Dietrich
Sven Dietrich on 12 Oct 2020
Edited: Matt J on 12 Oct 2020
Hallo zusammen,
I have following code to describe a rotation around the Z-Axis.
Code:
%
subplot(3,1,3);
vecInit = [0, 0, 1];
vecBar3 = quatrotate(quatinv(Q), vecInit);
vecBar3 = -1 * atan2(vecBar3(:,1), vecBar3(:,2));
vecBar3 = vecBar3*180/pi;
plot(t, vecBar3)
Q is a Nx4 Matrix, which has the information of the movement in form of quaternions.
Is it the correct idea or does somebody has a different, maybe easier, solution idea?

Answers (1)

Matt J
Matt J on 12 Oct 2020
  4 Comments
Sven Dietrich
Sven Dietrich on 12 Oct 2020
Yes nearly. I have a movement of a sensor which is shown in quaternions. And I would like to see the plot of X-Y-Plane to analyse the angle
Matt J
Matt J on 12 Oct 2020
Edited: Matt J on 12 Oct 2020
Syntax 3 will rotate a set of given points about an axis that you specify.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!