Calculating Bouncing Velocity from Tangent Angle in 2D Collision

  • Thread starter Thread starter hadyn
  • Start date Start date
  • Tags Tags
    Reflection
AI Thread Summary
The discussion revolves around calculating the new x and y velocities of a ball after it collides with a curved surface at a specific tangent angle. The original poster, a graphic designer, sought help due to a lack of formal math and physics training, expressing difficulty in using sine functions to achieve the desired bounce effect. A suggested method involved decomposing the ball's velocity into components parallel and perpendicular to the tangent, where the parallel component remains unchanged while the perpendicular component is reversed. After some confusion and experimentation, the poster successfully resolved the issue by correcting an inverted angle, leading to the desired bouncing behavior. The exchange highlights the importance of understanding basic physics principles in game development.
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.
 
Thread 'A quartet of epi-illumination methods'
Well, it took almost 20 years (!!!), but I finally obtained a set of epi-phase microscope objectives (Zeiss). The principles of epi-phase contrast is nearly identical to transillumination phase contrast, but the phase ring is a 1/8 wave retarder rather than a 1/4 wave retarder (because with epi-illumination, the light passes through the ring twice). This method was popular only for a very short period of time before epi-DIC (differential interference contrast) became widely available. So...
I am currently undertaking a research internship where I am modelling the heating of silicon wafers with a 515 nm femtosecond laser. In order to increase the absorption of the laser into the oxide layer on top of the wafer it was suggested we use gold nanoparticles. I was tasked with modelling the optical properties of a 5nm gold nanoparticle, in particular the absorption cross section, using COMSOL Multiphysics. My model seems to be getting correct values for the absorption coefficient and...
After my surgery this year, gas remained in my eye for a while. The light air bubbles appeared to sink to the bottom, and I realized that the brain was processing the information to invert the up/down/left/right image transferred to the retina. I have a question about optics and ophthalmology. Does the inversion of the image transferred to the retina depend on the position of the intraocular focal point of the lens of the eye? For example, in people with farsightedness, the focal point is...
Back
Top