Solved

Can someone quickly explain two circle shapes colliding?

Posted on 2000-05-01
5
153 Views
Last Modified: 2010-08-05
I need to know how to calculate the collision of two circular shapes for a project due in two days.  I have the whole program working (even a computer opponent) and obviously whats missing is the collisions.  I have the code if you need it.  Thanks
0
Comment
Question by:edone73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
ID: 2767729
If C1 (x1,y1) is center of the first circle, and C2 (x2,y2) of the second, calculate distance d from C1 to C2.
   d = sqr((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
Collision is if:
   d < r1+r2
where r1 and r2 are radiuses of the circles.
0
 

Author Comment

by:edone73
ID: 2767795
Hey Ameba, thanks for your answer.  But how bout the angles?  Please help me out.  I really need it.
0
 

Author Comment

by:edone73
ID: 2767817
I need to know how to calculate the angles once i calculate the distance (angles of deflection).
0
 
LVL 15

Expert Comment

by:ameba
ID: 2767825
Thanks for B.
Sorry, cannot help with angles now.
0
 

Author Comment

by:edone73
ID: 2768034
Why Not?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question