Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Problem: I'm struggling to compensate for the radius of a ball when reflecting it off a wall towards a target. (sorry I cannot yet post images)

What I want is to do this: golf reflections

but this does not compensate for the size of the ball. Any guidance would be helpful.

Would love to know how to compensate for this. Thanks!

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Offset the wall by the radius of the ball. By doing this, you compensate for the radius of the ball, so thereafter, you can consider the ball to be a point, and do the computations shown in your reference.

enter image description here

share|improve this answer
    
Thanks this helped me get my head around the problem. This issue is I am not doing the physics, Its being run on a physics engine and collisions are taken place on the edge of the ball. I could do what you are saying and reduce the collider to a point inside the puck, but that would lead to a bunch of collision skips. (small colliders tend to miss quite often) –  sinthetic May 6 '13 at 3:49
    
So in terms of this drawing, If i could figure out the place on the Original wall where the ball needs to reflect off of for this to work i would be set, I just don't know the math to accomplish it. –  sinthetic May 6 '13 at 3:56

If you consider a golf ball to be spherical, the ball touches the wall when the center is one radius away. If you normally track the ball location with the center, you can move the walls one radius inward and have the proper moment of reflection. If you want to account for the dimples it is much harder. You need to account for the orientation of the ball, then.

share|improve this answer
    
So if I instead track the ball from the top and find the angle of which a point at the top of the ball must move in to hit R' (the reflected hole) and then shoot the center of the puck along that angle would I end up with the desired results? Results have varied for me It does make it in most of the time. –  sinthetic May 6 '13 at 4:31

The point that is reflecting off a wall according to those rules is not the center of the ball but the point on the ball where it touches the wall. Thats how you account for it. If you have a rectangle, you only need to use 4 points on the ball plus its center.

share|improve this answer
    
I am deleting the comments regarding the inappropriate username on this thread. The original username, and description, were not appropriate at all, and have been changed to something less offensive. They have been recorded in a previous deleted comment. –  Eric Naslund May 6 '13 at 22:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.