Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Can someone quickly explain two circle shapes colliding?

Posted on 2000-05-01
Medium Priority
155 Views
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
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
• 3
• 2

LVL 15

Accepted Solution

ameba earned 150 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

ID: 2767795
0

Author Comment

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

LVL 15

Expert Comment

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

Author Comment

ID: 2768034
Why Not?
0

## Featured Post

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
###### Suggested Courses
Course of the Month6 days, 11 hours left to enroll