Finding Collision Angles in Pool Ball Refraction

In summary, the problem is that when two balls collide, the angle at which they hit each other is not always the same. To fix this, the programmer needs to find the angle that the two balls hit against each other, and then use this angle to move the balls back to their original positions.
  • #1
Kristy234
10
0
Hi, I'm currently working on a game of pool/snooker. Its all going great, but i have this problem when the balls hit each other. I can get them to bounce off the walls correctly, but that's because the walls are either vertical or horizontal...hitting a ball is more difficult.
At the moment, when a collision is detected, i need to find the angle that it hits against the tangent of two balls. I then need to alter this angle so that the output angle is the same as the input angle. Can anyone help with this? (I'm using Visual basic 6 if that's any help)
Thankyou
 
Technology news on Phys.org
  • #2
Do you mean hitting another stationary ball?
Then it shouldn't bounce off - the other ball should continue in a straight line in the direction the first one was going, the first one should stop at the point of contact.
 
  • #3
mgb_phys said:
Do you mean hitting another stationary ball?
Then it shouldn't bounce off - the other ball should continue in a straight line in the direction the first one was going, the first one should stop at the point of contact.

With your logic, only one ball would be moving on the table at anyone time. The ball would continue in a straight line and the other would stop only if it was hit head on. my main problem is when it kinda clips the ball so that some of the energy is transferred into the other ball but some also remains.
 
  • #4
Yes, sorry was thinking of another problem I'm working on at the same time!
Draw a line between the centres of the two balls, in the middle of this draw a line at right angles. The ball bounces off this line exactly as it would from a cushion.
 
  • #5
Yes, that is what I'm trying to do, however it is a little difficult as I'm working on coordinates. Each ball has an x and y position and moves a certain x and y every say millisecond. So i need to find the angle that it collides with, and all i have is an (x,y) position of ball1, and an (x,y) position of ball2, as well as the width and height of the ball, and the (x,y) that it moves by.
 
  • #6
So far this is what i have...I've commented it heavily because i don't know if you are familiar with vb6. 'n' represents a ball in an array, it is the ball that is originally moving. 'm' represents each other ball to test for a collision.

For m = 0 To 15 '(m is the variable for the array, so for all balls)
If (ball(m).Left - ball(n).Left) ^ 2 + (ball(m).Top - ball(n).Top) ^ 2 <= (ball(n).Width) ^ 2 And m <> n And (ball(m).Left - ball(n).Left) ^ 2 + (ball(m).Top - ball(n).Top) ^ 2 > 0 Then '(basically, if it has collided)
Dim alpha, beta, gamma As Double '(just some angles to use)
alpha = theta(n) '(theta(n) is the angle that the moving ball is traveling at)
'(then i try to define some angles...its hard to show how i got this without a diagram, but hopefully you will understand it)
If Abs(ball(m).Top - ball(n).Top) <> 0 Then
beta = Atn(Abs(ball(m).Left - ball(n).Left) / Abs(ball(m).Top - ball(n).Top))
Else
beta = 0
End

s(m) = s(n) '(s is just the speed, so transfer all the speed...i do this at the moment just for experimental purposes until i can get the rest of it working)

'(this is my attempt at getting the set correct angle)
theta(m) = 180 + alpha - 2 * beta '(theta(m) is the angle that the hit ball needs to travel at)
Y(m) = Sin(theta(m)) '(the y distance it should move every millisecond)
X(m) = Sin(90 - theta(m)) '(the x distance it should move every millisecond)

End If
Next

It's a bit messy, sorry.
 
Last edited:
  • #7
http://www.cc.uoa.gr/~ctrikali/aplets_web/fysiki_i/collisions.pdf" contains the trig you need to solve this.
 
Last edited by a moderator:
  • #8
Thanks, that really helped :)
 

What is refraction of pool balls?

Refraction of pool balls is the phenomenon of light bending as it passes through different mediums, causing objects to appear distorted or shifted. In the case of pool balls, this can occur when the ball is submerged in water, causing a slight change in its apparent position.

Why do pool balls appear to shift when submerged in water?

This is due to the change in the refractive index of the medium (water) compared to air. When light passes through water, it travels at a slower speed and is bent, causing the objects to appear shifted.

Does the color of the pool ball affect its refraction?

Yes, the color of the pool ball can affect its refraction. Darker colors tend to absorb more light, while lighter colors reflect more light. This can result in a difference in the amount of refraction and therefore, a difference in the apparent position of the ball when submerged in water.

How does temperature affect the refraction of pool balls?

Temperature can affect the refraction of pool balls in two ways. Firstly, temperature affects the refractive index of the medium, causing a change in the amount of refraction. Secondly, temperature can also affect the material of the pool ball itself, causing a change in its density and therefore, its refractive index.

Can refraction of pool balls be used in a game of pool?

No, the refraction of pool balls is a subtle effect and does not have a significant impact on the game. The rules of pool do not take into account the refraction of pool balls and it is not a significant enough factor to affect the outcome of the game.

Similar threads

  • Programming and Computer Science
Replies
11
Views
1K
Replies
14
Views
1K
Replies
5
Views
2K
Replies
1
Views
562
Replies
3
Views
917
  • Mechanics
Replies
10
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
23
Views
2K
  • DIY Projects
Replies
2
Views
1K
  • Introductory Physics Homework Help
5
Replies
157
Views
7K
Back
Top