Jump to content
  • Advertisement
Sign in to follow this  
LonelyStar

Moment of Inertia of a Polygon (2D)

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello together, OK, I have a convex polygon in a 2D plane. I want to calculate the moment of inertia of this polygon when it is rotating around the origin. Of course a 2D polygon can not really have a moment of inertia, so lets say it is a body with the ground-area being the polygon and the height of h=1. It shouldn't really matter because with a given mass, the moment of inertia should be independent from h. I have the mass and can get the densitiy without problems. Since the polygon is convex (and it is ensured, that the origin is within the polygon), one could split the polygon into a triangle fan around the origin ... but How could I calculate the moment of inertia of one of those triangles? Thanks for any help!

Share this post


Link to post
Share on other sites
Advertisement
oliii's tutorial has moment of inertia calculation plus a link to the formula.

yes, it can have inertia, lookup google moment of inertia thin disc or something else.

Share this post


Link to post
Share on other sites
double integral over the 2D region of (p*(x^2+y^2)) where x and y are relative to the point about which it is rotating and p is the density function

Share this post


Link to post
Share on other sites
from what I gathered,



// taken from
// http://www.physicsforums.com/showthread.php?s=e251fddad79b926d003e2d4154799c14&t=25293&page=2&pp=15
float PolyColl::CalculateInertia(const Vector* A, int Anum, float mass)
{
if (Anum == 1) return 0.0f;

float denom = 0.0f;
float numer = 0.0f;

for(int j = Anum-1, i = 0; i < Anum; j = i, i ++)
{
Vector P0 = A[j];
Vector P1 = A;

float a = (float) fabs(P0 ^ P1);
float b = (P1*P1 + P1*P0 + P0*P0);

denom += (a * b);
numer += a;
}
float inertia = (mass / 6.0f) * (denom / numer);

return inertia;
}






edit :
A ^ B is A.CrossProduct(B) = A.x*B.y - A.y * B.x;
A * B is A.DotProduct(B) = A.x*B.x + A.y * B.y;

Share this post


Link to post
Share on other sites
Thanks all of you!
I knew it had to be the integral over sqrt(x^2+y^2) but I do not know how to solve it.
Well, if the code from oliii works, I am quite happy!!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!