Slerp gives wrong values when fed an euler matrix [0,90,0]
Ältere Kommentare anzeigen
Hello,
I am trying out the slerp function to create an interpolation function so i made a simple program to test it on different values :
a = [0,90,1];
b = [1,1,1];
rotationSequence = 'XYZ';
rotationType = 'frame';
% conversion to quaternions
aa = quaternion(a,'eulerd',rotationSequence,rotationType);
bb = quaternion(b,'eulerd',rotationSequence,rotationType);
% Apply Spherical linear interpolation
cc = slerp(aa, bb, 0);
% Conversion back to euler
c = eulerd(cc,rotationSequence,rotationType);
A 0 is supposed to give me back the exact same a. But I get weird values everytime I put 90° in the second element of my matrix.
If I put :
- a = [0,90,1] --> I get c = [1.0000,90,0]
- a = [0,90,2] --> I get c = [2.0000,90,0]
- a = [0,90,3] --> I get c = [3,90,0]
- a = [0,90,4] --> I get c = [4.0000,90,0]
- a = [0,90,5] --> I get c = [48.814074834290350,89.999999146226360,48.814074834290350]
- a = [1,90,1] --> I get c = [2.0000,90,0]
- a = [5,90,5] --> I get c = [10,90,0]
Changing the rotation sequence or the rotation type will give wrong results as well.
Can anyone help me understand why ?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Quaternion Math finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!