Maths - Conversion Quaternion to Euler - Forum

By: Nobody/Anonymous - nobody
file Conversion Quaternion to Euler  
2005-01-20 06:30

https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm 
 
in the 2nd code example (non-normalised quaternion) these 4 lines need to be moved to beginning of function: 
 
double sqw = q1.w*q1.w; 
double sqx = q1.x*q1.x; 
double sqy = q1.y*q1.y; 
double sqz = q1.z*q1.z; 
 
 
ie to above this line which references them: 
double unit = sqx + sqy + sqz + sqw; 
// if normalised is one, otherwise is correction factor 
 
 
great site by the way, keep up the good work. 

By: Martin Baker - martinbaker
file RE: Conversion Quaternion to Euler  
2005-01-20 08:58

Thanks again, 
 
Martin


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover If you are interested in 3D games, this looks like a good book to have on the shelf. If, like me, you want to have know the theory and how it is derived then there is a lot for you here. Including - Graphics pipeline, scenegraph, picking, collision detection, bezier curves, surfaces, key frame animation, level of detail, terrain, quadtrees & octtrees, special effects, numerical methods. Includes CDROM with code.

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.