09-10-2000, 09:03 PM

Hi,

Do u know an algorithm to convert a matrix to a quaternion?

Do u know an algorithm to convert a matrix to a quaternion?

View Full Version : Quaternions from matrix?

09-10-2000, 09:03 PM

Hi,

Do u know an algorithm to convert a matrix to a quaternion?

Do u know an algorithm to convert a matrix to a quaternion?

PeterFromRussia

09-11-2000, 09:35 AM

Only orthogonal matrix A can be converted.

You have to find vector v=<x,y,z> such that

Av=v, | |v| | =1

So A is a rotation around v.

You have to find angle (alpha) of rotation.

Quaternion you want to find is given by:

q=< cos(alpha/2.),

x*sin(alpha/2.),

y*sin(alpha/2.),

z*sin(alpha/2.)>

You have to find vector v=<x,y,z> such that

Av=v, | |v| | =1

So A is a rotation around v.

You have to find angle (alpha) of rotation.

Quaternion you want to find is given by:

q=< cos(alpha/2.),

x*sin(alpha/2.),

y*sin(alpha/2.),

z*sin(alpha/2.)>

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.