Calculating Velocity Vector After Polygon Collision - Madison

In summary, the conversation discusses the creation of a class for collision detection in a 2-dimensional game with a polygon defined by a set of points. The equation to describe the resulting velocity vector after the collision is being sought, with the goal of eliminating the perpendicular component of the velocity and continuing on a path parallel to the edge. The solution involves projecting the velocity vector onto the edge vector to get the final velocity. A general formula for inelastic collisions is also mentioned as a helpful resource.
  • #1
mbrown3391
6
0
I am currently programming a 2-dimensional game and am creating a class that will allow for collision detection with any polygon defined by a set of points. The actual collision detection was easy, however i am having trouble coming up with an equation to describe the resulting velocity vector of an object after the collision.

http://www.cheeseparade.com/diagram.png

Based on the diagram above, can anyone give me an equation that will return the blue vector as a function of the green vector, regardless of the angle of the green vector? All the red points are known information at any given time.

Thanks,
Madison
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
I'm not quite sure what I'm looking at here... what should the relationship be between the blue vector and green vector? Or in other words, what kind of physical situation are you trying to simulate? What happens to the object that collides with the polygon?
 
  • #3
when the object collides, the component of its velocity that is perpendicular to the edge that it collides with should be eliminated so that the object continues on a path parallel to the edge. i don't need to worry about bouncing at this point.
 
  • #4
OK, I see... you're talking about a totally inelastic collision. I'm assuming you have (or can calculate) the velocity vector [itex]\vec{v}[/itex] as well as the vector pointing along the edge of the polygon in the direction of the blue arrow, which I'll call [itex]\vec{p}[/itex], and also that you either have or can write a function to take dot products. Then you can just project [itex]\vec{v}[/itex] on to [itex]\vec{p}[/itex] to get your final velocity:
[tex]\vec{v}\,' = \frac{\vec{v}\cdot\vec{p}}{\vec{p}\cdot\vec{p}}\ \vec{p}[/tex]

Incidentally, a general formula for inelastic collisions can be found on Wikipedia, http://en.wikipedia.org/wiki/Coefficient_of_restitution.
 
  • #5
Thank you! that equation worked perfectly.
 

Related to Calculating Velocity Vector After Polygon Collision - Madison

1. How do you calculate the velocity vector after a polygon collision?

To calculate the velocity vector after a polygon collision, you will need to use the conservation of momentum and energy equations. First, you will need to calculate the initial momentum and energy of the objects before the collision. Then, you will need to determine the final momentum and energy after the collision. Finally, use these values to calculate the final velocity vector of the objects.

2. What factors affect the velocity vector after a polygon collision?

The velocity vector after a polygon collision can be affected by several factors, including the masses and velocities of the objects involved, the angle of collision, and the coefficient of restitution, which measures the elasticity of the collision. Other factors such as the shape and material of the objects may also play a role in determining the final velocity vector.

3. Can the velocity vector after a polygon collision be negative?

Yes, the velocity vector after a polygon collision can be negative. This indicates that the object is moving in the opposite direction from its initial velocity. The direction of the velocity vector is determined by the angle and direction of the collision, as well as the masses and velocities of the objects involved.

4. How does the conservation of momentum apply to calculating the velocity vector after a polygon collision?

The conservation of momentum states that the total momentum of a closed system remains constant before and after a collision. This means that the total momentum of the objects before the collision must equal the total momentum after the collision. By using this principle, we can calculate the final velocity vector of the objects involved in the collision.

5. Are there any limitations or assumptions when calculating the velocity vector after a polygon collision?

When calculating the velocity vector after a polygon collision, it is important to note that this is an idealized calculation and may not always accurately reflect real-world collisions. This calculation also assumes that the objects involved are rigid bodies, and that there are no external forces acting on the system. Additionally, the calculation may not be accurate for complex collisions involving multiple objects or non-uniform shapes.

Similar threads

Replies
14
Views
1K
  • Classical Physics
Replies
13
Views
2K
Replies
1
Views
2K
Replies
13
Views
7K
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
34
Views
728
Replies
4
Views
3K
Replies
1
Views
2K
Back
Top