|   Registered Member   
 | 
							Hi, I have some code that constructs a transformation matrix like so: 
 Where b, c, d, u, v, w, x, y, z are all sensible doubles read in from a data file. If I then try to recalculate the Quaternion coefficients like so: 
 and then compare the coefficents (.vec()) of Q1 and Q2 they are precisely the negative of each other. However, Quaternions with opposite coefficients are not equivalent. Am I missing something about Quaternion maths, or is this a bug? | 
|   Moderator   
 | 
							q and -q do represent the same rotation.
						 | 
|   Registered Member   
 | 
							Yes, you are right. Thank you. I was dealing with a data format that only stores the x, y, z Quaternion coefficients, and then requires w >= 0 to save space. If you reverse x, y, z, but not w you do get a different rotation, which is what I was seeing. All fixed now and definitely a bug in my thinking, not in Eigen. | 
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]
 
		 
		 
		 
		