Rotation around a tilted axis.


by cake21
Tags: axis, rotation, tilted
cake21
cake21 is offline
#1
Nov5-11, 09:12 AM
P: 1
I am writing a little code that should make an object revolve around a tilted axis.

Here is what I have:
-The center coordonates
-A normal array (3 numbers between 0 and 1);
-position of the object.

Is there a way to do this?

I think:
http://en.wikipedia.org/wiki/Rodrigu...tation_formula
Should be it , but I can't work out how to use it. Does the formula return an array?
Phys.Org News Partner Science news on Phys.org
NASA's space station Robonaut finally getting legs
Free the seed: OSSI nurtures growing plants without patent barriers
Going nuts? Turkey looks to pistachios to heat new eco-city
Stephen Tashi
Stephen Tashi is offline
#2
Nov9-11, 10:51 AM
Sci Advisor
P: 3,173
I can't work out how to use it. Does the formula return an array?
Which formula in that article are you talking about?

If you want a conceptually simple way of doing it, consider this:

Do you know how to write code that would change from one coordinate system to another? If you change coordinates so that the "center" of the rotation becomes the origin in the new coordinate system and the axis of rotation becomes the z-axis in the new coordinates system then you can apply the formula for rotating an object about the z-axis. Get the coordinates of interest in the new coordinate system and then transfer those coordinates back to the original coordinate system.

I've read articles by people who do computer animation that say that using quaterions is the best way to deal with the motion of objects. Are you doing animation?
chiro
chiro is offline
#3
Nov9-11, 06:39 PM
P: 4,570
Quote Quote by cake21 View Post
I am writing a little code that should make an object revolve around a tilted axis.

Here is what I have:
-The center coordonates
-A normal array (3 numbers between 0 and 1);
-position of the object.

Is there a way to do this?

I think:
http://en.wikipedia.org/wiki/Rodrigu...tation_formula
Should be it , but I can't work out how to use it. Does the formula return an array?
Hey cake21 and welcome to the forums.

One method you might want to consider is to use quaternions and then after you computer the final output quaternion, convert it to a linear transformation (matrix) and then apply that matrix to the points you need to do.

The reason why I recommend this is because if you want to multiple rotations, or some something like rotation interpolations, quaternions are probably the best way of doing this, and building a quaternion library is not a hard thing to do either.


Register to reply

Related Discussions
2-axis rotation to 3-axis lift Advanced Physics Homework 1
How to find angular momentum of a body about an axis other than the axis of rotation? Introductory Physics Homework 11
earth's axis of spin w.r.t. galactic rotation axis General Astronomy 6
If the Earth's axis was tilted 45 degrees.. Biology, Chemistry & Other Homework 2
Rotation about axis in R3 Calculus & Beyond Homework 9