# Remove rotation around a given axis.

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, If I have a rotation matrix (or quaternion if its easier?) and an axis, is there anyway I can remove any rotation done around that axis from the matirx. Its for a rotating wheel and I want to be able to ignore any rotation around the rolling axis. Any suggestions would be great!! Cheers, Mark.

##### Share on other sites
How a rotation happens:
b = R*a

Notation: "~" means "inverse". Ie: ~X is the inverse of X.

An axis is associated with a rotation -- namely, a rotation that rotates the axis to point along a basis vector.

Let X be the rotation that is associated with your axis and the basis vector "1 unit strait up" (aka, Z). X rotates your axis to align with the Z axis.

Then define R := X*R*~X

R is "the rotation R in a rotated space".

Note:
X*b = R*X*a

What is the point of all of this?

Well, the rotation R corresponds very closely with your rotation R. But in the space that R acts on, the axis you want to remove rotation on is the Z axis!

Removing all rotation along a basis vector isn't all that hard of a problem. Let U be R with all rotation around the Z axis removed.

Now, define
U := ~X*U*X

And U is the rotation matrix R with all rotation around the axis in question removed.

Can you figure out how to remove all rotation around the Z asis from a rotation matrix or a quaternion?

##### Share on other sites
If it is in the context of a physics engine, you may have to set moment of inertia around that axis to be infinite, or you might get some weird result if you just cancel the rotation.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5
frob
13

• 9
• 15
• 10
• 9
• 17
• ### Forum Statistics

• Total Topics
632602
• Total Posts
3007363

×