#### Archived

This topic is now archived and is closed to further replies.

# Integration Confusion

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

## Recommended Posts

I''ve started reading the book ''Physics for Game Developers'' and in the first few pages it shows you how to calculate the centre of mass of a body. These are the equations it gives (S being the integration sign Xc = (S Xo dm) / m Yc = (S Yo dm) / m Zc = (S Zo dm) / m where (X,Y,Z)c are the coordinates of the centre of mass, (X,Y,Z)o are the coordinates to the centre of mass from each elemental mass and dm is the elemental mass. Now what I''m not getting here is what do you have to intergrate with respect to? I can''t see how you can intergrate (X, Y ,Z)o with respect to m which is what it seems to be asking you to do. I haven''t actually been taught calculus in school yet but I''ve been reading ahead in my maths book and I can differentiate simple functions (i.e. 4x^2 + 5x), itergrate simple functions and I understand how you can use intergration to represent a sumation, but I''m not quite getting how it''s being used here.

##### Share on other sites
You have to do a substitution.
In this case, dm = density * dV.
So if you are assuming constant density, Xc = (S Xo dV) / (S dV)
Then dV = dx * dy * dz, so in fact you doing a triple integral over the body.

"Math is hard" -Barbie

##### Share on other sites
Ahh thank you I understand it now.

##### Share on other sites
in words the formula is: (distance from origin)=(the sum of all elements*distancefromorigin)/(total mass).

might help. or it might not. its not a very easy topic, certainly not in three dimensions. but this is all quite theoreticly, since IRL you actually never have continous functions which to integrate.

therefore i recommend you just do a numerical approach, ie taking the average of all masses multiplied by their position (see the similarity with the above formula?).

##### Share on other sites
What a coincidence, the professor in my Physics class was doing center of mass this week. Spooky!

Anyway, the complexity of the problem depends on a few factors. For instance, the complexity of the function defining the space perpendicular to the direction of variable of integration (i.e if integrating with respect to x, then the perpendicular y/z area, etc.). It also depends on the density function. If both are constant functions, then they cancel out and you are left with integrating first- and second-degree polynomials, which are sweet beans. If only one is constant, then that one cancels out too. At any rate, the hardest part of any of this is figuring out the perpendicular distance/area as a function of the third variable if they don''t give you nice equations to start with. Like y/z area as a function of x. It''s cases like these where I like rectangular prisms

##### Share on other sites
lol, I have that book too!

##### Share on other sites
Well the author also gives

Xc = (E Xo m)/(E m)

Where E is that big greek E thing used for summations (can''t remeber what it''s proper name is). I''m sure you can see what the formulae for Yc and Zc are going to be.

THe author says to worry too much about the itergrals but personally I like having at least a rough understanding of all formulae presented in a book even if the author says not to worry about them.

Thanks guys.

##### Share on other sites
Σ

it's SIGMA!!!!

[img]http://www.solace.ru/alphabets/sigma_md_wht.gif[/img]

[edited by - wormball on October 25, 2003 10:13:52 AM]

##### Share on other sites
yeah its a sigma. it stand for summation, sort of numerical integration. no offence, but seeing the nature of your questions i indeed wouldnt bother with integration: no matter how smart you are, its not going to be a thing youll just figure out in a couple of hours. and besides, as i said, the whole integrating thing is very theoretical, since you ''never'' have a nice function describing your model, but rather an irregular mesh.
so the numerical summation on finitly small elements is the best way to go, and requires only knowledge about finding an average.

##### Share on other sites
quote:
but seeing the nature of your questions i indeed wouldnt bother with integration: no matter how smart you are, its not going to be a thing youll just figure out in a couple of hours.

Well as I''ve already said I like having a rough understanding of things and I did teach myself everything I know about intergration in just a few hours so my understanding is indeed rough

1. 1
Rutin
26
2. 2
3. 3
4. 4
5. 5

• 10
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632941
• Total Posts
3009337
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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!