0 Up votes0 Down votes

5 views3 pagesMar 21, 2011

© Attribution Non-Commercial (BY-NC)

DOCX, PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

5 views

Attribution Non-Commercial (BY-NC)

- Sim Mechanics
- Centre of Mass Frame of Reference
- momentum and impulse ppt
- Simulacro Practica2
- Impulse n Momentum
- 193014215 Tugas PS 2 Moment Full
- Work Power Energy
- Physics Semester 1 Vocabulary
- Momentum
- 125760133 Buckling of Thin Metal Shells 151
- GMp 2001 Question
- 20101129
- Physics time
- Introduction
- 2002 Jan QP
- Definitions XI Standard
- 09-01-jm-q.pdf
- Solution Report (0).pdf
- 12MMIMH037 Exam
- November 2017 (v3) QP - Paper 2 CIE Physics A-level.pdf

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]

- Sim MechanicsUploaded byStefan Ristevski
- Centre of Mass Frame of ReferenceUploaded bys
- momentum and impulse pptUploaded byapi-285179261
- Simulacro Practica2Uploaded byHugo Emmanuel Valencia Santamaria
- Impulse n MomentumUploaded byMohammed Aftab Ahmed
- 193014215 Tugas PS 2 Moment FullUploaded byAntonio Cervantes
- Work Power EnergyUploaded byShivendra Agarwal
- Physics Semester 1 VocabularyUploaded by12vwala
- MomentumUploaded bykraytos krieger
- 125760133 Buckling of Thin Metal Shells 151Uploaded bypawkom
- GMp 2001 QuestionUploaded bysanjeev
- 20101129Uploaded byjmith
- Physics timeUploaded byEdney Melo
- IntroductionUploaded byNikko San Quimio
- 2002 Jan QPUploaded byKaushal
- Definitions XI StandardUploaded byFredrick
- 09-01-jm-q.pdfUploaded byAaryan Sharma
- Solution Report (0).pdfUploaded byKanchan Srivastava
- 12MMIMH037 ExamUploaded byMatthew Lee
- November 2017 (v3) QP - Paper 2 CIE Physics A-level.pdfUploaded byLithara
- StructureUploaded byalibaho
- Cbse Class 11 Physics Syllabus 2011-12Uploaded bySunaina Rawat
- M1LmarksUploaded bydasha962
- engineering.docxUploaded bysaxenamohit_853663
- Distributed Active Traction Control System Applied to the RoboCup Middle Size LeagueUploaded byAurel GS
- Election Affected Centre ListUploaded byMadhu
- Product Hollow Sections 2Uploaded bysmvisu
- otc15383Uploaded byadeshinexx
- 139255752-UHX-Calcs-xlsUploaded byRajesh Panchal
- Lecture1 Mechanics HandoutUploaded bypingli

- hlt5675sUploaded byEARLPOKIE
- R410a PT ChartUploaded byRefrigerant Guys
- Flow RigUploaded bysg3569
- Atomic StructureUploaded byKunalKaushik
- GE StenoscopUploaded byManuel Casais Tajes
- Castrol Magnatec 5w 30 Engine Oil a3 b4Uploaded byDana Nistor
- hydraulicsystem-151006111015-lva1-app6892 (1)Uploaded byKishorkumar Chandrasen Ukirde
- Comparative Analysis of the BRICsUploaded bySesan Fesobi
- Geotechnical Engineering for Mine Waste Storage FacilitiesUploaded byhiyeon
- Boiler-Tuning Basics, Part II.pdfUploaded byIain Neill
- 4M12FillUploaded byDương Tiến Trung
- RO CTOP ManualUploaded byY Gangadhar
- L1-L3-MTT-Course-Intro-History-Applications.pdfUploaded byrahil
- fit windowsUploaded byKaren Cairney
- DOE HDBK 1132 99 Reaffirmed 2014Uploaded byevo2005_2006
- MAC Cylinder Wear LimitUploaded byJose Ortiz
- At6311 Ac Lab ManualUploaded byvivek kumar
- Reaction Mechanism Theory EUploaded byVaibhav Jain
- Flying Wind MillUploaded bychuday6
- Gas Monetization in BangladeshUploaded byF-10
- Properties of RefrigerantUploaded byzesrdtfyghuj
- User's Manual ABB GeneratorsUploaded bySebastian Nicușor Părăoanu
- Elec-packaging HW1-Dhaval Rana.docxUploaded byAlan White
- Rotary DryersUploaded byJose Lorenzo Toral
- BPEOUploaded byAfsoon Ashtari
- 164601794 EVS Lec 17 Natural Resources DepletionUploaded byumzz
- SLAC_Lab_Agenda_FY16_Q2 FINAL 4.22.16.pdfUploaded bySharlyn Narag
- 2357 Typological Evolution of High Rise Buildings in Terms of Thermodynamics and Energy FormationUploaded byLeOn Wzz 众
- 10-hybrid-joining-techniques_2015.pdfUploaded byVũ Đức
- Volume-IUploaded byVISHWAJIT

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.