# Bouncing on a trampoline

1. Jul 29, 2011

### Subliminalman

Currently I am making a small video game where a cat is constantly falling through the sky! I want to add in some trampolines that when hit you will bounce according to the trampolines angle.

What equation would I use to perform this function?

I have provided a picture to help illustrate what I am trying to achieve

For all of you programmers out there here is the code that I used so far

if (trampTime <= 0)
{
//trampRotation is in radians
character.velocity.Y = 10 * (float)Math.Sin(trampRotation);
character.velocity.X = 10 * (float)Math.Cos(trampRotation);
}
trampTime++;
if (trampTime > 30)
{
character.trampoline = false;
trampTime = 0;
}

Any help would be greatly appreciated

#### Attached Files:

• ###### example.jpg
File size:
5.2 KB
Views:
145
2. Jul 29, 2011

### Drakkith

Staff Emeritus
You might try the Computer and Technology forum instead of General Physics. You should have the best chance of getting help there!

3. Jul 30, 2011

### MATLABdude

Welcome to PhysicsForums!

Since you seem to grok code, I presume that you're more interested in the physics of the situation, rather than code that models the physics.

If you make the assumption that the bounce is completely elastic (not a bad assumption, for the lulz) the angle of incidence will be the same as the angle of reflection, as measured from the normal of the plane (or, in your case, trampoline):
http://en.wikipedia.org/wiki/Collision
http://en.wikipedia.org/wiki/Deflection_(physics)

If you make the assumption that you don't have perfectly elastic collisions, you have to do some vector analysis (all while dealing with gravity, as I presume you are).

Last edited: Jul 30, 2011
4. Jul 30, 2011

### Staff: Mentor

Yes, I agree that a physics forum is probably better for this particular question, since it's basically a physics question. If the OP wants to get into discussing the programming code specifically, the "Programming & Comp Sci" forum would be the place for that.