Equations for detecting collision

  • Thread starter kachilous
  • Start date
  • Tags
    Collision
In summary, the conversation discusses the creation of a program to simulate an object being thrown off a building and the desire to implement collision detection. The equations needed for this task are discussed, including finding the time of collision and the object's velocity and position at impact. The object's coefficient of restitution is also mentioned. The concept of time step analysis is explained as a possible approach for computing the necessary data for each step in time.
  • #1
kachilous
15
0
I have created a program that simulates an object being thrown off a 50 m building.
Now I would like to implement collision detection. What equations would I need to accomplish this? I am taking Physics right now, so my Physics is a little rusty.

I know I will have to find the time of collision:
timeImpact = (-vy - sqrt((vy*vy) - (2*ay*y)) / (2*.5*ay))

Will I also have to find the object's velocity and position at impact too?

I also decided that the object's coefficient of restitution will be .5.
So I know I will have to factor that in as well.

Any help would be appreciated.
 
Physics news on Phys.org
  • #2
You will need the position (y) of the object. When the position of the object is equal to the altitude of the ground (y=0) its collided. In order to analyze the post collision dynamics you will probably also want the time and velocity. If your approach is a time step analysis, it is quite easy to also compute the time, position, velocity, acceleration in a time step table format.
 
  • #3
What do you mean by time step analysis?
 
  • #4
A time step analysis uses a constant increment of time, say 0.1 sec, and computes the necessary data (total time, position, velocity, acceleration) for each step in time. Then uses those results to compute the next increment.
 
  • #5


Great job on creating a program that simulates an object being thrown off a building! To implement collision detection, you will need to use the equations of motion to calculate the object's velocity and position at impact. These equations are:

- Velocity at impact (vf) = initial velocity (vi) + acceleration (a) * time of impact (t)
- Position at impact (xf) = initial position (xi) + initial velocity (vi) * time of impact (t) + 1/2 * acceleration (a) * (time of impact (t))^2

In your case, the initial position would be 50 m (since the object is being thrown off a 50 m building), and the initial velocity would be the initial velocity of the object at the time of throwing. The acceleration in this case would be due to gravity, which is -9.8 m/s^2.

You are correct in using the time of collision equation to find the time of impact. Once you have the time of impact, you can plug it into the equations of motion to find the object's velocity and position at impact.

In order to factor in the coefficient of restitution, you will need to use the following equation:

- Final velocity after impact (vf') = coefficient of restitution (e) * initial velocity (vi)

You can then use this final velocity to calculate the object's new position using the equation for position at impact mentioned above.

I hope this helps you with your project. Keep up the good work! As a scientist, it's important to always refresh and apply your knowledge of Physics. Good luck!
 

FAQ: Equations for detecting collision

1. How do equations for detecting collision work?

Equations for detecting collision involve using mathematical calculations to determine if two objects are intersecting or in close proximity to each other. These equations take into account the positions, velocities, and sizes of the objects involved.

2. What is the purpose of using equations for detecting collision?

The main purpose of using equations for detecting collision is to accurately determine when two objects in a simulation or game have collided. This information can then be used to trigger certain actions or behaviors, such as a sound effect or a change in the game's score.

3. Are there different types of equations for detecting collision?

Yes, there are different types of equations for detecting collision depending on the type of objects involved and the complexity of the simulation. Some common types include bounding box collision, circle-circle collision, and polygon collision.

4. How accurate are equations for detecting collision?

The accuracy of equations for detecting collision depends on a variety of factors, such as the quality of the code implementation and the precision of the objects' positions and velocities. With well-written code and properly defined objects, equations for detecting collision can be very accurate.

5. Can equations for detecting collision be used for 3D objects?

Yes, equations for detecting collision can be used for both 2D and 3D objects. However, the calculations involved can become more complex in a 3D environment, requiring more advanced mathematical techniques and potentially impacting the performance of the simulation or game.

Similar threads

Replies
9
Views
1K
Replies
14
Views
2K
Replies
4
Views
1K
Replies
3
Views
2K
Replies
14
Views
2K
Replies
2
Views
1K
Replies
1
Views
1K
Back
Top