ok, here’s a simple tutorial on calculating the exit angle for a vertical wall… In doing the pinball machine, we’re going to need to know how to calculate at what angle the ball is going to bounce when it hits a surface. This is a pretty simple example… the behavior of a ball when it hits a wall… this example applies to whatever angle the ball hits…from the left, from the right, if the ball is going up or if the ball is going down… cause those directions are described by the angle of the ball.
I attached a gif image for you guys to see… Please look at it while reading this tutorial.
Phi = the symbol with the circle with the vertical line
theta = the symbol with the oval with the horizontal line
alpha = the other symbol…
In this example, phi is the direction (or the angle) of the velocity vector of the ball. We know this, because angle and velocity are properties of our ball object. All angles start at 0, and continue counterclockwise to 360. If you compare it to a watch, 0 degrees is at 3 o’clock, 90 degrees is at 12, 180 degrees is at 9 o’clock,
270 degrees is at 6 o’clock, and 360 degrees is back at 3 o’clock.
theta is the angle of incidence… this is the angle at which the ball hits RELATIVE to the wall. It is measured from the line of the trajectory of the ball towards the wall…
alpha is the exit angle… it is the angle at which the ball will go after hitting the wall. Alpha is not relative.
when an object hits the wall, it comes in towards the wall at an angle of theta (from the initial direction to the wall) and it leaves the wall at the same angle (from the wall to the final direction). If you look at the diagram, it makes sense.
so lets calculate the angles…
theta = 270 - Phi
alpha = 270 + theta
it follows that
alpha = 270 + 270 - Phi
alpha = 540 - Phi
the neat thing about angles is that they overlap… so you can subtract so 70 degrees is equal to (70 + 360) degrees. This means that we can subtract 360 degrees from 540 and so…
alpha = 180 - phi.
So to find at what angle your ball is going to travel after hitting a vertical wall, just substract the angle your ball is traveling from 180…
now mind you, this is only for a VERTICAL wall… for a horizontal wall things are different… alpha = 360 - phi… you should find that out on your own.
Angled surfaces are different, and I’ll talk about them next