# Another topic about torque rotation etc :P

## Recommended Posts

WiredCat    1450

I found like 3 topics about that already here but i want to start another one:

my problem is:

i know i would have to know the density of an object etc, i would just like to know the formula if the body rotates around its center of gravity.

thanks

##### Share on other sites
Buckeye    10747

As you seem to know, the force applied will result in a torque (R cross F). Are you using <*> to represent a vector cross-product? If not, that's incorrect. It is not a multiplication. In any case, it appears you're representing the object as a simple pendulum. I.e., T = mr2 * alpha, where alpha is the angular acceleration. Your equation then would be angular_velocity = dt * (torque)/(mr2). Your "alpha" is, then, not the angle.

Using <x> to represent a cross-product: Torque (R x F) is to angular acceleration as force is to linear acceleration. Torque is a vector whose direction is the axis of rotation, and whose length is the magnitude of the angular acceleration. N.B., although force is applied to the mass of the object, torque is applied to the moment-of-inertia of the object, and that moment-of-inertia is specific with respect to the rotation axis though evaluation of the inertial tensor for the object. You can google for "inertial tensor" or "moment of inertia" to determine how the moment of inertia is specified for a particular distribution of mass.

I.e.,

force = mass * linear_acceleration;

torque = moment-of-inertia * angular_acceleration; // N.B., moment-of-inertia (MOI), not mass.

So, for discrete dt's:

// linear parameters

linear_acceleration = force / mass;

linear_velocity += linear_acceleration * dt;

change_in_linear_position = linear_velocity * dt;

// rotational parameters

angular_acceleration = torque / MOI;

angular_velocity += angular_acceleration * dt; // I think this is the equivalent of your "alpha" equation.

change_in_current_angle = angular_velocity * dt; // is this what you want to approximate?

EDIT - Note: if your looking for the absolute angle, and not the change in the angle, you have to accumulate the changes in angle, as, over time, the angular velocity caused by the torque will continue to change the angle. I.e., you apply a torque for dt, and the object will "spin," not just change angle and stop rotating.

Edited by Buckeye

##### Share on other sites
WiredCat    1450

ok that cleared everything up, now i will read about that inertia calculation, i already have one book that coevers it but i understand like 99% of it and that 1% is the cooridnate system guy uses :} so i think i will ask again in a matter of 2-3 days. Thanks! really.

##### Share on other sites
WiredCat    1450

i just dont get it how torque gets from vector to a single floating point i mean when ve have RxF / MR^2 shouldit return vector instead of number?

##### Share on other sites
Waterlimon    4398

If in 2D, assuming youre doing 3D cross product (I dont think its even defined for 2D), just use the z-component of the result for your single float (the x and y should be 0 in any case).

Torque is a vector in 3D and a scalar in 2D so I assume that confused you.

And there is an operation to get the single float directly but its just not called cross product I think, dont know what its called.

Edited by Waterlimon

##### Share on other sites
Buckeye    10747

i just dont get it how torque gets from vector to a single floating point i mean when ve have RxF / MR^2 shouldit return vector instead of number?

Torque is a vector = RxF. RxF/ mr2 is the angular acceleration for a pendulum or similar, and that is also a vector. Neither torque nor angular acceleration "gets" to a floating point value.

Can you provide a reference to something that implies what you're saying?

##### Share on other sites
WiredCat    1450

angular_acceleration = torque / MOI;

angular_velocity += angular_acceleration * dt; // I think this is the equivalent of your "alpha" equation.

change_in_current_angle = angular_velocity * dt;

since change in current angle is  a vector, i cant imagine how to retreive yaw pitch roll angles from that

irrelevant khatharr told me what to do

Edited by WiredCat