# kinetic energy

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

## Recommended Posts

I want to know the total kinetic enery of a rigid body in 3D. Now I know how to compute the energy of the translation float Ek = mass * dot(velocity) * 0.5; but realy have no idea what to do with the formula for the rotation energy Ek = I * rotvel² * 0.5 In 2D this would be simple as 'I' only is a single float, but in 3D it's a 3x3 matrix. I would realy appreciate if someone shared some code with me ( and everyone else in this forum )

##### Share on other sites
You are probably talking about the moment of inertia
there is a link : http://www.gamedev.net/community/forums/topic.asp?topic_id=322238

##### Share on other sites
Quote:
 Original post by maxime959You are probably talking about the moment of inertia

nope ...I'm talking about kinetic energy
Here's a link to what Im talking about for those of you who don't know what it is
http://mechatronics.technion.ac.il/rotordynamics/html/kinetic.htm

'I' in the formula is the moment of inertia.

Quote:
 Original post by maxime959there is a link : http://www.gamedev.net/community/forums/topic.asp?topic_id=322238

I started that thread =)

##### Share on other sites
You have to remember that in 3D, the angular velocity ("rotvel") is described by a 3D vector (as opposed to a scalar in 2D). The norm of the vector represents the velocity of rotation while its direction represents the axis of rotation. Given this, the kinetic energy is given by

K_rot = 1/2 * w_trans * I * w

where w_trans is the transposed w vector.

Hope it helps.

##### Share on other sites
Mh, I should go to sleep :)

I suggest maybe ( from your link ) : Ek = 0.5 * w.transpose() * I * w;
with w a vector and I the moment of inertia

##### Share on other sites
hmm ...how do i transpose a vector then? =)

##### Share on other sites
Quote:
 hmm ...how do i transpose a vector then? =)
All that means is that if the convention is to use column vectors, treat the vector as a row vector, and vice versa. In the example given:

K_rot = 1/2 * w_trans * I * w

The convention is column vectors, and so in a matrix-vector multiplication the matrix goes on the left. If you want to multiply a vector by a matrix on the right, you transpose the vector so that it becomes a row vector. In practice you can implement this as a special mult function for the matrix class, or have two '*' functions, one that takes a vector on the left and a matrix on the right, and one that is the other way around.

##### Share on other sites
TotalKE = .5f*(linMomentum.dot(linVel) + rotMomentum.dot(rotVel));

##### Share on other sites
Quote:
Original post by jyk
Quote:
 hmm ...how do i transpose a vector then? =)
All that means is that if the convention is to use column vectors, treat the vector as a row vector, and vice versa. In the example given:

K_rot = 1/2 * w_trans * I * w

The convention is column vectors, and so in a matrix-vector multiplication the matrix goes on the left. If you want to multiply a vector by a matrix on the right, you transpose the vector so that it becomes a row vector. In practice you can implement this as a special mult function for the matrix class, or have two '*' functions, one that takes a vector on the left and a matrix on the right, and one that is the other way around.

Actually it does not matter wether it is row or collume mayor since I is symetics

##### Share on other sites
Quote:
 Actually it does not matter wether it is row or collume mayor since I is symetics
Technically you can only multiply a row vector to the left of a matrix and a column vector to the right, so it does matter in that sense. Also, I'm not sure if this is what you mean, but unless I'm mistaken the inertia matrix is not necessarily symmetrical.

1. 1
2. 2
Rutin
22
3. 3
A4L
15
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633742
• Total Posts
3013639
×