Skip to main content
GameDev.net gamedev.net
🔒 Locked

Just need a little explaining

Started by dustydoodoo Dec 1, 2008 at 9:51 PM 10 replies 1.3k views
Original Post
dustydoodoo
dustydoodoo
In Chris Hecker's article, he gives an equation for finding the impulse needed for collision response. I just can't seem to "solve for j/Impulse" given this equation RelativeVelocity + Impulse/MassOfObjectA + Impulse/MassOfObjectB = -e * RelativeVelocity which, once its has been rearranged should be Impulse = -(1 + e) * RelativeVelocity * (MassOfObjectA + MassOfObjectB) It does make sense to me, but I just don't know how (1 + e) gets there. I've been trying for some time to solve for "j" but I just can't! It would really help if someone could do it step by step for me. I feel as if it is actually really simple, but for some reason I just can't figure it out on paper! I probably wrote it wrong on here, but i hope that someone just gets the point.
Sure i will write my signature, just gimme a piece of paper
mattnenterprise
mattnenterprise
It has -(1 + e) which is the same as this -1(1 + e) which when you multiply -1 and 1 you get -1 + e which equals -e.
AlfredR
AlfredR
Let me shorten the names of your varibles so that the form of the equation is easily seen:

V + I/Ma + I/Mb = -e * V

For this you simply move all terms without I to the right hand side

I/Ma + I/Mb = -e * V - V

Factor I out on the left. (We can simplify the right a little too by factoring out -V)

So: I (1/Ma + 1/Mb) = -V(1 + e)

We can divide both sides by that factor of ( 1/Ma + 1/Mb ) to isolate I

I = -V (1+e) / (1/Ma + 1/Mb)

It looks like the answer is a little different than you expected.

If you prefer we can simplify a little more by putting 1/Ma + 1/Mb into a single fraction by expressing it over a common denominator:

1/Ma + 1/Mb = (Ma + Mb)/(Ma*Mb)

So that:

I = -V (1+e) * (Ma*Mb)/(Ma + Mb)

Hope that helps.
Sleek
Sleek
RelativeVelocity + Impulse/MassOfObjectA + Impulse/MassOfObjectB = -e * RelativeVelocity


RelativeVelocity + e * RelativeVelocity = - Impulse / ( MassofObjectA + MassofObjectB )

- Impulse = ( 1 + e ) * RelativeVelocity * ( MassofObjectA + MassofObjectB )

Impulse = - ( 1 + e ) * RelativeVelocity * ( MassofObjectA + MassofObjectB )


Simple math..
dustydoodoo
dustydoodoo
Quote:
Original post by mattnenterprise
It has -(1 + e) which is the same as this -1(1 + e) which when you multiply -1 and 1 you get -1 + e which equals -e.


Hmm? -1 + e = -e? is that right!?

Sure i will write my signature, just gimme a piece of paper
AlfredR
AlfredR
Quote:
Original post by Sleek
...

RelativeVelocity + e * RelativeVelocity = - Impulse / ( MassofObjectA + MassofObjectB )

...

Simple math..



This line is incorrect since I/Ma + I/Mb = I*(1/Ma + 1/Mb) = I * (Ma + Mb)/(Ma*Mb) which is not the same as I /(Ma + Mb), as you have written (try it with numbers). Remember that when adding fractions you must put them over a common denominator.
AlfredR
AlfredR
Quote:
Original post by dustydoodoo
Quote:
Original post by mattnenterprise
It has -(1 + e) which is the same as this -1(1 + e) which when you multiply -1 and 1 you get -1 + e which equals -e.


Hmm? -1 + e = -e? is that right!?


No, it isn't. But what i think he was trying to say is that -(1+e) = -1(1+e) = -1 + -e, which is correct.
dustydoodoo
dustydoodoo
Thanks Alfred! I would say thanks to the person that replied after you, but I was a little insulted by "Simple math.." I always seem to get offended when people use "..." I really need to get better at these kinds of things. I guess its because I don't practice much.
Sure i will write my signature, just gimme a piece of paper
AlfredR
AlfredR
Quote:
Original post by dustydoodoo
Thanks Alfred! I would say thanks to the person that replied after you, but I was a little insulted by "Simple math.." I always seem to get offended when people use "..." I really need to get better at these kinds of things. I guess its because I don't practice much.



No problem. Are you familiar with vector arithmetic? I took a look at the Chris Hecker article and you should watch out for the vectors that come up in these equations. Vab is a vector and Vab dot n gives the component of the velocity vector in the direction of n. You'll run into trouble treating them as pure numbers. Here's a little tutorial incase you're a bit rusty:

http://www.math.hmc.edu/calculus/tutorials/vectoranalysis/

Good luck.
dustydoodoo
dustydoodoo
Quote:
Original post by AlfredR
Quote:
Original post by dustydoodoo
Thanks Alfred! I would say thanks to the person that replied after you, but I was a little insulted by "Simple math.." I always seem to get offended when people use "..." I really need to get better at these kinds of things. I guess its because I don't practice much.



No problem. Are you familiar with vector arithmetic? I took a look at the Chris Hecker article and you should watch out for the vectors that come up in these equations. Vab is a vector and Vab dot n gives the component of the velocity vector in the direction of n. You'll run into trouble treating them as pure numbers. Here's a little tutorial incase you're a bit rusty:

http://www.math.hmc.edu/calculus/tutorials/vectoranalysis/

Good luck.


Thanks for the link! I do know a little about vector math (cross and dot product, addition/subtraction) But I've yet to really do much with it. So having this to look to is excellent! thanks.

Sure i will write my signature, just gimme a piece of paper
Sleek
Sleek
Why would you feel offended by that ? It's algebra and a simple one at, that's a fact.

y = mx + c

x = (y - c )/m


I sure don't feel offended that someone pointed out that I just failed at simple math :). Silly me for using Notepad instead of real pen and paper.

edit:

RelativeVelocity + Impulse/MassOfObjectA + Impulse/MassOfObjectB = -e * RelativeVelocity


RelativeVelocity + e * RelativeVelocity = - Impulse *( 1/MassOfObjectA + 1/MassOfObjectB )

- Impulse = ( 1 + e ) * RelativeVelocity / ( 1/ MassofObjectA + 1/MassofObjectB )

- Impulse = ( 1 + e ) * RelativeVelocity / ( ( MassofObjectA + MassofObjectB ) / ( MassofObjectA * MassofObjectB ) )

Impulse = ( 1 + e ) * RelativeVelocity * ( ( MassofObjectA * MassofObjectB ) / ( MassofObjectA + MassofObjectB ) )

So yeah.. AlfredR is right :)

[Edited by - Sleek on December 2, 2008 12:55:28 AM]
dustydoodoo
dustydoodoo
So after a little algebra refresher, I think I've un-rusted my skills in Algebra. Something I found odd is that, there are some things I don't remember learning in the first place! I guess it happens when you're mostly self educated. So hopefully I won't bother you guys with anymore of these basic questions. But it may happen again! At least I know that I will always have a place to ask. So thanks guys :)
Sure i will write my signature, just gimme a piece of paper

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.