I want to rotate a point using Quaternion function
Show older comments
i want to rotate point (1,2,3) about x-axis by 45 using quaternion function
i tried to put it in identity matrix and rotate it but it's not working also i want to plot is q.plot()
here is the function of the matlab
P = [1 2 3];
R = transl(P)*eul2tr([0 0 0])
q = Quaternion(R)
R1 = R * trotx(45);
q1 = Quaternion(R1)
2 Comments
James Tursa
on 6 Apr 2020
Edited: James Tursa
on 6 Apr 2020
I read through the link you provided, and unfortunately like 99% of all quaternion stuff I read online this one also lacks in specifying the quaternion convention used. There is no description of the Quaternion(R) algorithm used or the Quaternion.R method algorithm. Can you generate a random direction cosine matrix, perform both these operations, and post the results? Then maybe I can figure it out.
EDIT Nevermind ... I found a different link that has the direction cosine matrix to quaternion conversion code. I can figure it out from that.
James Tursa
on 6 Apr 2020
Can you give a numeric example of the inputs and desired output? I.e., give us the starting vectors and angles, and tell us what you would expect to get as output.
Accepted Answer
More Answers (2)
Matt J
on 6 Apr 2020
q1*[1;2;3]
4 Comments
Hassan Bosha
on 6 Apr 2020
Matt J
on 6 Apr 2020
probably because R has a translation in it ...
Hassan Bosha
on 6 Apr 2020
Matt J
on 6 Apr 2020
Well, it's 3rd party code, so you will probably have to consult with the person who wrote it.
Matt J
on 6 Apr 2020
You could also try this FEX submission instead of the Quaternion class
>> AxelRot([1;2;3], 45, [1 0 0], [])
ans =
1.0000
-0.7071
3.5355
Categories
Find more on Coordinate Transformations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!