Calculate ball velocities after slope bounce

In summary, the individual is seeking assistance with their final project for a programming class, specifically with detecting 2D collision between a ball and a rotating line. They are struggling with changing the ball's velocity after collision and have attempted using basic trigonometry and the rotation of the line to calculate the angle of reflection. However, their method has not been successful and they are looking for suggestions, such as using vector manipulation, to improve their solution.
  • #1
DrKrunklehorn
5
0

Homework Statement



Hello! I'm working on my final project for a programming class. Currently I can successfully
detect 2D collision between a ball, and a line that can rotate in any direction.

However when the ball hits the line I need to change it's velocity so it bounces
in the right direction. I'm not worrying about elasticity or friction or anything, just
post collision direction.

Homework Equations



I know basic Trig is involved and maybe Dot product, but I'm pretty sure we don't need that.

The Attempt at a Solution



I thought if the racket was horizontal, it would be as easy as incident angle = reflection
angle. But as the racket tilts upward I pictured the reflection angle decreases at the same
time.

So I tried taking the racket's rotation relative to the ground and subtract it from the ball's
movement angle. This I thought would be the new angle of reflection.

Sadly it didn't work out. Sometimes the ball sort of bounces in the right direction but it's
really shoddy.

Thanks for the assistance!
 
Physics news on Phys.org
  • #2
Why not work out the vectors for the case that the racket is at zero degrees then rotate the vectors by the racket angle using either matrix or quaternion methods. You may need to detect if that ball hits the top or the bottom of the racket.
 

Related to Calculate ball velocities after slope bounce

What is the formula for calculating ball velocities after slope bounce?

The formula for calculating ball velocities after slope bounce is v = √(g * h * sinθ), where v is velocity, g is the acceleration due to gravity, h is the height of the slope, and θ is the angle of the slope.

What is the acceleration due to gravity?

The acceleration due to gravity, denoted as g, is a constant value of 9.8 m/s^2. This value represents the rate at which objects accelerate towards the Earth's surface due to the force of gravity.

How do you measure the height of the slope?

The height of the slope can be measured using a measuring tape or ruler. Simply measure the distance from the bottom of the slope to the highest point.

What is the angle of the slope?

The angle of the slope can be measured using a protractor or angle measuring tool. Place the tool on the slope and determine the angle at which it is positioned.

Can this formula be used for any type of slope?

This formula can be used for any type of slope as long as the height and angle of the slope are accurately measured. However, it is important to note that external factors such as air resistance and surface friction may affect the accuracy of the calculated velocities.

Similar threads

  • Introductory Physics Homework Help
Replies
16
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
7
Views
3K
  • Introductory Physics Homework Help
Replies
13
Views
6K
  • Introductory Physics Homework Help
Replies
34
Views
784
  • Introductory Physics Homework Help
Replies
32
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
23
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
2K
Back
Top