Physics Equations

Robotoer

Member
Nov 9, 2004
39
0
0
I'm currently trying to program a physics engine of some sort. I would like it to be able to calculate changes in velocity, spin, direction, and shape of objects during a collosion. I've gotten to being able to calculate the changes in velocity of 1 dimensional point masses. I used Conservation of Momentum and Conservation of energy to come up with the most evil quadratic i've ever seen. I am having trouble with 1 dimensional collisions with compression taken into account. For example, lets say two 1 dimensional objects(line segments) collide. you are given their masses, velocities, and their compressability(i don't know what to use for this). once they collide, how do you find the new volume(length) of the 1 dimensional objects and their new velocities? Also, how do you calculate spin and how do you get the new direction of an object if it doesn't hit a surface head-on?

I would appreciate any help. Thankz in advance.





The Math:
M = momentum, m = mass, v = velocity, E = energy

Momentum of an object given it's mass and velocity(includes direction)
M = mv

Energy of an object given it's mass and velocity
E = (1/2)mv^2

Conservation of Momentum - momentum in a collision is neither created or lost
Momentum of object 1 + momentum of object 2 = new momentum of object 1 + new momentum of object 2

Written with variables:
(m1 = mass of object 1, m2 = mass of object 2, v1 = original velocity of object 1, v2 = original velocity of object 2, v3 = new velocity of object 1, v4 = new velocity of object 2)
m1*v1 + m2*v2 = m1*v3 + m2*v4

Conservation of Energy - energy in a collision is neither created or lost
Energy of object 1 + energy of object 2 = new energy of object 1 + new energy of object 2

Written with Variables:
(m1 = mass of object 1, m2 = mass of object 2, v1 = original velocity of object 1, v2 = original velocity of object 2, v3 = new velocity of object 1, v4 = new velocity of object 2)
(1/2)m1*v1^2 + (1/2)m2*v2^2 = (1/2)m1*v3^2 + (1/2)m2*v4^2


Okay... ready for the quadratic of doom? First, if your wondering why i'm getting another equation, here's why: I solved for v3(new velocity of object 1) so i could use that to solve for v4. Remember, this is going into a program, so i need to find an equation that can work for all situations. First what i did was solve one of the equations for v4. I then substituted the value into the other equation and solved for v3. By doing that i came up with this evil quadratic:

v3 = ( - (( 2 * pow (m1, 2) * v1) + (2 * m1 * m2 * v2)) + sqrt ( pow (((2 * pow (m1, 2) * v1) + (2 * m1 * m2 * v2)), 2) - 4 * (( -m1 * m2)- pow (m1, 2)) * ((-pow (m1, 2)*pow (v1, 2)) - (2 * m1 * m2 * v1 * v2) + (m1 * m2 * pow (v1, 2))))) / (2 * ((-m1 * m2) - (pow (m1, 2))))

Yeah... Trust me, it works. I basically ended up using the quadratic forumula, except a, b and c all were made up of other variables. This works, because everything except for v3 and v4 are given.
 

ChiBOY83

Senior member
Dec 28, 2004
517
0
0
..you might have better luck posting this in "highly technical"...many ppl in here just sorta say "quake 4 rockz" or "quake 4 blows!!" .........try there instead. this might make our heads fry in this section
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |