#### Archived

This topic is now archived and is closed to further replies.

# Pool balls 'visible' from cue ball

This topic is 5330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
I can make a diagram to help you get started, but I dunno if I have a place to put the image or not.

##### Share on other sites
email it to me at (gary at 4mm.co.uk) and i''ll post it here in a message after putting it on my website

##### Share on other sites
Well if you you have balls a and b you can find the angle as a bearing at which a should be fired at to touch exactly the edge of b through this:

Find the bearing of the centre of b from the centre of a. Then to get the clockwise edge add
arcsin( radius*2 / distance between balls )
for the anticlockwise edge subtract this.

I think that should do the trick. There is probably a more computationally efficient method with vectors but this one works on paper.

To see if you can hit a ball past the blocking one you can compare the angles. If the angles to the blocking ball are wide enough to contain the angles to the ball to be hit then the ball cannot be hit.

##### Share on other sites
This should give a good look of how it's done:

As you can see, by either adding or subtracting acos(2r/d) to the angle of the line between the midpoints you get the angle to find the tangent.

Given this quick bit of explination and a picture to help visualize, it should be easy to do the rest.

(Sorry if my explination isn't very good. It's starting to get late here )

EDIT: Ooops.. looks like Drath beat me, and I accidentally put acos instead of asin

EDIT: What am I talking about? I was right the first time when I said arccos. (zdir: post the first image I sent you, it's the right one )

Shoot Pixels Not People

[edited by - drakonite on April 12, 2004 8:48:16 PM]

boom!

##### Share on other sites
I hope that clears it up for you

TBH, if you can''t figure it out from here I have some bad news for you... A pool game is going to be very hard for you to do. You''d be amazed at just how much math like this is needed

Pool physics are not that simple. (Although I guess a simplified pool game is possible.. just not very realistic.)

Drakonite

Shoot Pixels Not People

##### Share on other sites
Yeah but let's face it, I'm considering a fairly advanced feature such as this before writing a single line of code. Surely I deserve some kind of planning/design kudos - I've seen plenty of people berated on these forums for showing obvious signs of "jumping the gun" with regard to their abilities. I think I'm swimming at a steady pace rather than sinking.

[edited by - zdlr on April 12, 2004 9:02:49 PM]

##### Share on other sites
Don''t get me wrong... I didn''t mean to berate you or anything like that. I have no idea of what your abilities are and I am not going to make comments about what you can or can''t do.

I simply meant it as a helpful comment, that at this point if the math for finding the tangents seems like greek, and you can''t figure out how to go from the angles to points on the circle, trying to make a pool sim will be a very rough ride as the majority of it will be this same type of math, but a bit more complex.

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633319
• Total Posts
3011346
• ### Who's Online (See full list)

There are no registered users currently online

×