Calculating Bouncing Velocity from Tangent Angle in 2D Collision

  • Context: Undergrad 
  • Thread starter Thread starter hadyn
  • Start date Start date
  • Tags Tags
    Reflection
Click For Summary

Discussion Overview

The discussion revolves around calculating the new velocities of a ball after it collides with a curved surface in a 2D environment. The focus is on understanding the reflection mechanics based on the tangent angle at the point of collision, without considering factors like friction or gravity.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant describes the scenario of a ball with independent x and y velocities colliding with a curved shape and seeks to determine the new velocities post-collision based on the tangent angle.
  • Another participant suggests finding the components of the velocity parallel and perpendicular to the tangent, indicating that the parallel component remains unchanged while the perpendicular component should be reversed during the collision.
  • The original poster expresses confusion regarding the terminology and methodology, indicating a lack of familiarity with mathematical concepts necessary for the calculations.
  • The original poster later reports successfully resolving the issue, attributing the problem to an inverted angle that affected the ball's trajectory.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a specific methodology for calculating the new velocities, as the original poster ultimately resolves their issue independently. The discussion reflects a mix of confusion and clarification without a definitive solution being established among participants.

Contextual Notes

The discussion highlights limitations in the original poster's understanding of mathematical functions and their application in the context of collision mechanics, which may affect the clarity of the proposed solutions.

hadyn
Messages
3
Reaction score
0
Hello there,

Let me start by saying this question is going to make me look somewhat ridiculous considering the complexity of most other questions floating around here, but I'm not a maths or physics student and never have been; rather I'm a graphic designer with a basic query in relation to a game I'm making in flash. That said, forgive me if I don't use the right terminology, so far I'm more or less entirely self taught in what basic physics I know.

So here's the problem:

I have a ball moving in 2D with independent x and y velocities. That ball collides with a curved shape - when this happens, I'm able to find the tangent at which it collides - the effect I want to achieve is simply of the ball bouncing from that tangent in the correct reflected direction (with no concern for fricition, gravity or anything like that).

So, for example, say the ball's x velocity is 4 pixels per second and the y velocity is 2 pixels per second (flash is upside down, a positive y value actually implies downward movement), and it hits the curve at a 35 degree tangent - how do I find what the new x and y velocities should be?

I've been working on this all night and I've come quite close - using various sine functions I was able to at least make the ball retain the same overall velocity when it bounced, but I can't for the life of me get it to bounce in the right direction and I'm not sure why, so I figured it'd be pointless showing you guys my code which doesn't work if someone can simply offer a method that does.

In short:

I have the x and y velocities (and therefore the overall speed and direction) of a ball and the angle of the tangent at which it hits a curve. I need to set new x and y velocities to make it appear to have bounced off naturally - how?

Thanks heaps for any help,
Hadyn
 
Science news on Phys.org
hadyn said:
In short:

I have the x and y velocities (and therefore the overall speed and direction) of a ball and the angle of the tangent at which it hits a curve. I need to set new x and y velocities to make it appear to have bounced off naturally - how?
Since you have the angle that the velocity makes with the tangent, try this. Find the components of the velocity parallel and perpendicular to the tangent. During the collision, the parallel component will remain unchanged but the perpendicular component will be reversed.

You'll have to work out the details of converting back and forth between x&y and parallel & perpendicular. Should be straightforward.
 
Whilst I'm slightly confused by some of those terms, that at least sounds pretty much like what I've been trying, but I still don't know the exact methodology. It's not really a case of being able to work it out, it's a case of simply not knowing how to use the tools available (sine functions, etc).

Assume I know very little about math. It's been years since high school and beyond the most basic use of Pythagoras I've more or less forgotten everything I'd learned. Before reading up on it yesterday, I had no idea how any of those angle functions worked, and because it's such a new concept and I've already got my brain full of other new concepts in terms of hit detection and other code I've been writing, I just... can't figure it out. I'm willing to admit I've gone completely brain dead. Not only that, but I've probably tried too many different things to get it working now that what I have is way too complex and confusing and relies on too many variables, any of which could potentially be wrong.

At the very least I've been able to make my application draw three lines: the trajectory when it hits, the tangent, and the desirable reflected trajectory... so I'm assuming that means my angles are okay - I just can't seem to get the proper new x and y velocities so that it actually takes up this new trajectory.

I'm more or less asking for an exact methodology, if you can. I'd love to be able to work this out for myself, but without knowing how it's done at all I feel lost.

Thanks heaps,
Hadyn
 
Nevermind, I'm proud to announce I fixed it. What I had was right, it's just that one of my angles was inverted so it was acting weird... It works perfectly now. Cheers for the advice.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
Replies
27
Views
1K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
3
Views
1K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 19 ·
Replies
19
Views
6K