Created
March 18, 2016 01:39
-
-
Save SIRHAMY/6d7a14a4dbeb3126ff89 to your computer and use it in GitHub Desktop.
Example showing how to add two Eigen::Quaterniond values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Eigen::Quaterniond myQuaternion; //This is the quaternion we want to store the result in | |
//These are the two quaternions we'll be adding together | |
Eigen::Quaterniond q1 = initializeMyQuaternion(exampleParam); //We'll say it initializes to some random, valid vals | |
Eigen::Quaterniond q2 = initializeMyQuaternion(exampleParam2); | |
//Perform the addition | |
myQuaternion.w() = q1.w() + q2.w(); //Add the scalar portion | |
myQuaternion.vec() = q1.vec() + q2.vec(); //Add the vector portion | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment