5 views

Uploaded by pocoyo21k

- Mass Energy Equivalence
- Tutorial 2.4
- Earthquake engineering & Structural dynamics
- QWZ COM PHY DOC
- ap physics 1 syllabus finchum 2014-2015
- ejercicios mecánica clasica
- The Animate and the Inanimate - William James Sidis
- Engineering Mechanics 1(1)
- Answer Tutorial 2
- data analysis project
- 10.1.1.475.5650
- Adams Basic Syllabus - 5 Days (1).pdf
- dd
- Chap 6 Momentum
- Chapter 9 Homework
- MEPC10 Lecture Plan
- Analisis Por Elementos Finitos Estructura de Tripode
- ExperimentalResults Prof.jader (1)
- Front(Page 1)
- Determinate Analysis

You are on page 1of 3

collides.

This is actually easier with circles. If you have two

circles of radius r1 and r2, a collision has occurred if

the distance between the centers is less than r1+r2.

The distance between the two centers (x1,y1) and

(x2,y2) can be calculated and compared as:

d = sqrt((y2-y1) * (y2-y1) + (x2-x1) * (x2-

x1));

if (d < r1 + r2) { ... bang ... }

Or, as jfclavette points out, square roots are expensive

so it may be better to calculate using just simple

operations:

dsqrd = (y2-y1) * (y2-y1) + (x2-x1) * (x2-

x1);

if (dsqrd < (r1+r2)*(r1+r2)) { ... bang ...

}

The tricky bit comes in calculating the new

movement vectors (the rate at which (x,y) changes

over time for a given object) since you need to take

into account the current movement vectors and the

point of contact.

I think as a first cut, you should just reverse the

movement vectors to test if the collision detection

works first.

Then ask another question - it's better to keep

individual questions specific so answers can be

targeted.

edited Apr 23 '09 answered Apr 23 '09

at 3:57 at 3:29

link|edit|flag

gnovice paxdiablo

30.8k52856 127k12152383

3 Just a note: square roots are rather

costly operations, and you can

square both sides of the equation

since they are both positive. That

gives you d^2 = (y2-y1) * (y2-y1)

+ (x2-x1) * (x2-x1) and (d^2 <

(r1+r2)^2) as a test. – jfclavette

Apr 23 '09 at 3:37

Good point, @jfclavette,

especially if you want maximum

frames/sec, incorporated into

answer. – paxdiablo Apr 23 '09 at

3:48

780240

Detecting a collision is only the first

up vote 2 down vote step. Let's break that down.

The fastest thing to do is calculate their

square bounding boxes and see if those

collide. Two of the sides need to cross

(top of 1 and bottom or 2, and left of 1

and right of 2, or vice versa) in order

for the bounding boxes to overlap. No

overlap, no collision.

Now, when they do overlap, you need

to calculate the distance between them.

If this distance is more than the sums of

the radii of the balls, then no collision.

Okay! We have two balls colliding.

Now what? Well, they have to bounce

off each other. Which way they bounce

depends on a few factors.

The first is their elasticity. Two rubber

balls bouncing off each other rebound

differently than two glass balls.

The second is their initial velocity.

Inertia states that they'll want to keep

going in mostly the same direction they

started in.

The third is the mass of the balls. A ball

with smaller mass will rebound off a

much larger mass with a higher

velocity.

Let's deal with the second and third

factors first, since they are intertwined.

Two balls will rarely hit exactly dead

on. Glancing blows are far more likely.

In any case, the impact will happen

along the normal of the tangent where

the balls collide. You need to calculate

the vector component of both along this

normal given their initial velocities.

This will result in a pair of normal

velocities that both balls will bring to

the collision. Add up the sum and store

it somewhere handy.

Now we have to figure out what each

ball will take away from it. The

resulting normal velocity of each ball is

inversely proportional to the given ball's

mass. That is to say, take the reciprocal

of each ball's mass, add both masses

together, and then parcel out the

resultant normal velocity away from the

collision based on the ratio of the ball's

mass to the sum of the reciprocal of

both ball's masses. Then add the

tangential velocity to this, and you get

the resultant velocity of the ball.

Elasticity is mostly the same, except it

requires some basic calculus due to the

fact that the balls are still moving even

as they compress. I'll leave it to you to

find the relevant math.

For the case of two colliding bodies in two-dimensions, the overall velocity of each body

must be split into two perpendicular velocities: one tangent to the common normal surfaces of

the colliding bodies at the point of contact, the other along the line of collision. Since the

collision only imparts force along the line of collision, the velocities that are tangent to the

point of collision do not change. The velocities along the line of collision can then be used in

the same equations as a one-dimensional collision. The final velocities can then be calculated

from the two new component velocities and will depend on the point of collision. Studies of

two-dimensional collisions are conducted for many bodies in the framework of a two-

dimensional gas.

In a center of momentum frame at any time the velocities of the two bodies are in opposite

directions, with magnitudes inversely proportional to the masses. In an elastic collision these

magnitudes do not change. The directions may change depending on the shapes of the bodies

and the point of impact. For example, in the case of spheres the angle depends on the distance

between the (parallel) paths of the centers of the two bodies. Any non-zero change of

direction is possible: if this distance is zero the velocities are reversed in the collision; if it is

close to the sum of the radii of the spheres the two bodies are only slightly deflected.

Assuming that the second particle is at rest before the collision, the angles of deflection of the

two particles, and , are related to the angle of deflection θ in the system of the center of

mass by [2]

- Mass Energy EquivalenceUploaded byKosma Kosmic
- Tutorial 2.4Uploaded byNurul Afiqah Mohmmad Najib
- Earthquake engineering & Structural dynamicsUploaded bySugumar S
- QWZ COM PHY DOCUploaded byrahuljain1
- ap physics 1 syllabus finchum 2014-2015Uploaded byapi-266428938
- ejercicios mecánica clasicaUploaded byNeiser Cerna Guerrero
- The Animate and the Inanimate - William James SidisUploaded byinvalidated
- Engineering Mechanics 1(1)Uploaded byRITIK SHARMA
- Answer Tutorial 2Uploaded bySolehah Omar
- data analysis projectUploaded byapi-309363754
- 10.1.1.475.5650Uploaded byFredrick
- Adams Basic Syllabus - 5 Days (1).pdfUploaded byAshwin Raghavan
- ddUploaded byPremsai Gc
- Chap 6 MomentumUploaded byMaylene Diaz
- Chapter 9 HomeworkUploaded byitsheartmoving
- MEPC10 Lecture PlanUploaded byhakeemniyas
- Analisis Por Elementos Finitos Estructura de TripodeUploaded byJaime Patrón
- ExperimentalResults Prof.jader (1)Uploaded byRichard Senko
- Front(Page 1)Uploaded byHani NekOsuki
- Determinate AnalysisUploaded byViviana Escala Castillo
- Collision TheoryUploaded byAkshatKhanna
- ECPISD V(r4.3)-C2Uploaded bytamerragaa
- energy unitUploaded byapi-253805002
- Problem as Vi Brac i OnesUploaded byIvan Jair Aguilar
- homework 1.pdfUploaded byShahidul Islam Shahariar
- Curtin University - Student Timetable_ My Timetable - EStudentUploaded byJoseph Grant
- Exercise Book StaticsUploaded byStephany Alonso
- Qp Em and Header 2014Uploaded byatulkumargaur26
- Physics Assessment AnsweUploaded byIzyan Ismail
- nodecodesampleUploaded byapi-249715354

- 299945059-Detailed-Lesson-Plan-for-Collisions.pdfUploaded byGerlie Velasco
- 00053005.pdfUploaded byLakshya
- Question 1060Uploaded byShaikh Usman Ai
- General ZoologyUploaded bySittie Fatmah Hayamirah Sinal
- Final Exam Review ProblemsUploaded byIrina Stefania
- precalc3Uploaded byApichaya
- Thermo QuistionsUploaded byخالد الدوسي الزهراني
- Chapter 3 Example of 2D CollisionUploaded byMohdYasir
- Reaction Dynamics Lecture Notes 2012Uploaded byabowafeek__
- 2 Forces and Motion SUploaded byRuddyMartini
- 9702_s16_erUploaded bySubarna Lamsal
- Collisions Powerpoint for Physics Apple tUploaded byMhwaqxLhadyblue
- Car Crash LabUploaded byMatthew Somerville
- Torsion PendulumUploaded byFrancu Lucian
- Gaseous State and ThermodynamicsUploaded byJhon Harrison
- Impulse and Momentum Type 2 Part 1 of 1 EngUploaded byRajuhappy Agarwal
- Physics Unit PlansUploaded byGajendra
- 9702_s13_qp_23.pdfUploaded byHema Bhaskar
- CollisionsUploaded byudayabg
- 0716932458_ProgressiveUploaded byLuisgarciaBerlanga
- Dynamics!!!!!Uploaded byDan Warren Loyola Nuestro
- Class XI Jee Advanced Paper FinalUploaded bydheeraj Shah
- Collision TheoryUploaded byTanmoy Roy
- Chapter 3 Impulse and MomentumUploaded byAnonymous rpcAOp
- LEP_WebUploaded byCristhoper Mera
- Erosion in pipesUploaded byRafael.Augustinis
- Momentum II Problem SolvingUploaded byVanessa Arbelaez
- rube goldberg machineUploaded byapi-248907105
- UPK1 PhysicsUploaded byErmie Dharlya
- Phy Kinetic Theory of GasesUploaded bySachin