This forum has been archived. All content is frozen. Please use KDE Discuss instead.

AngleAxisf dependent on input vector magnitude?

Tags: None
(comma "," separated)
amzuko
Registered Member
Posts
2
Karma
0
Hello all,

Using Eigen::AngleAxisf to generate rotation matrices, I have found that the results are dependent on the magnitude of the input axis. That is to say, if I normalize the input axis to affine3f the results are different (and correct) compared to the results without normalization. This was, for me at least, rather non-intuitive. See this snippet of code:


Code: Select all
    Eigen::Vector3f one;
    Eigen::Vector3f two;
    one<<.056,1.3,19;
    one.normalize();
    two<<.032,.001,10;
    two.normalize();
   
    Eigen::Vector3f cross  = one.cross(two);
    Eigen::Affine3f without_normalization;
    without_normalization = Eigen::AngleAxisf(.05, cross);
    Eigen::Affine3f with_normalization;
    with_normalization = Eigen::AngleAxisf(.05, cross.normalized());
   
    std::cout<<"without normalization of axis in angleaxisf:\n"<<without_normalization.linear()<<std::endl;
   
    std::cout<<"with normalization of axis in angleaxisf:\n"<<with_normalization.linear()<<std::endl;


which results in this output

without normalization of axis in angleaxisf:
0.998756 1.0924e-05 1.25782e-05
-1.0881e-05 0.99875 -0.00340663
-1.26153e-05 0.00340663 0.99875
with normalization of axis in angleaxisf:
1 0.000164571 0.000180807
-0.000155329 0.99875 -0.0499786
-0.000188806 0.0499786 0.99875


Is this known behavior?

best,

Andrew
amzuko
Registered Member
Posts
2
Karma
0
Whoops, so I'm a dufus -- the docs mention this, although the tutorial page on geometry does not.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
This has been clarified in the manual.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]