Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Snooker Physics Problem

Posted on 2003-03-28
10
Medium Priority
?
539 Views
Last Modified: 2013-12-26
I have the cue ball on my snooker table. The Cue tip rests at the cue ball, and the user swings the cue round wth the mouse. Now, the velocity exerted on the cue ball by the cue is directly through the centre of the cueball, given an angle theta that the cue is around the ball in the XZ plane, how do i represent the velocity vector? This is my current calculation, and through a process of guesstimation, ive tried different COS/SIN combinations and still dont get anything sensible.

cueball.set_velocity_x(sin(cue.angle*DEG2RAD));
cueball.set_velocity_z(cos(cue.angle*DEG2RAD));
0
Comment
Question by:gobbo18uk
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 8226949
How do you get cue.angle?
0
 
LVL 1

Author Comment

by:gobbo18uk
ID: 8227043
cue.angle is obtained from the mouse. As the user moves left or right, the cue swings around the cue ball. It is also clamped between 0 and 360 degrees.
0
 
LVL 1

Author Comment

by:gobbo18uk
ID: 8227085
If you would like a visual idea of what I mean, please visit my site, then under the uni-work section from the menu bar, select the snooker simulation and there is a screenshot.

http://www.steve-chamberlain.co.uk/

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:NeilNeilOrangePeel
ID: 8227446
I think u want to use x = cos(theta) - sin(theta), y = sin(theta) + cos(theta)
0
 
LVL 1

Author Comment

by:gobbo18uk
ID: 8230055
I have tried that but the result does not seem to be correct. I am also (for the time being) discounting the Y-axis as a simplification to my system (i.e. the balls are confined to the XZ plane and you cannot do a 'jump' trick shot). Thanks for the input though.
0
 

Accepted Solution

by:
NeilNeilOrangePeel earned 150 total points
ID: 8231585
sorry If the snooker table is in the x-z plane I meant:
x = cos(theta) - sin(theta), z = sin(theta) + cos(theta)
0
 
LVL 85

Expert Comment

by:ozo
ID: 8232002
what did you get when you tried
cueball.set_velocity_x(sin(cue.angle*DEG2RAD));
cueball.set_velocity_z(cos(cue.angle*DEG2RAD));
?
what did you use for cue.angle and DEG2RAD?
0
 
LVL 1

Expert Comment

by:Hermetic
ID: 8236604
This is going to sound like a bunch of silly questions, but based on your description, I can't think of anything else to add. (sounds like it should work)

What level of detail are the cueball velocity and cue angle numbers stored in? (float or double)

Are you sure that you have stored the cue angle in degrees?

Are you sure that the sign is correct for your velocity equations?

Are you sure you have the correct conversion for cue angle in DEG2RAD?

What do you mean by sensible? (completely wrong or a little off)
0
 
LVL 1

Author Comment

by:gobbo18uk
ID: 8236927
The velocity and angle are stored as floats.

The angles is stored in degrees, and the conversion to radians is correct.

I am now sure that :

x = cos(theta) - sin(theta)
z = sin(theta) + cos(theta)

is the correct answer and will accept this as the answer, it provides 'correct' results, i.e the ball moves at the same speed in any direction, as opposed to when it was moving very fast in one direction then just slipping in another direction. However I still have some problems, but i can sort those out in due course.

0
 

Expert Comment

by:froobly
ID: 8770357
Sorry to dig up a dead topic, but the accepted solution sounds completely wrong.  I think that the problem is that you're not multiplying cos(theta) or sin(theta) by the speed of the cue.

The equation should be Vx = speed*cos(theta); Vy = speed*sin(theta);

If this doesn't work, then it means that you're giving this function incorrect values for speed and theta.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question