1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rotating a pool ball

  1. Dec 3, 2007 #1
    I'm trying to create a simple pool game. The ball is moving with speed vx along x axis and vy along y axis. This way I can easily compute the rotation in x and y direction. But how can I compute the rotation when the ball is not moving along any axis? I mean in angle 30 degrees, for example. Because rotating by angle about x axis followed by rotation by angle along y axis doesn't give the right result.

    Thanks for any suggestions.

    http://www.fi.muni.cz/~xkacer/other/ball.png" [Broken]
    Last edited by a moderator: May 3, 2017
  2. jcsd
  3. Dec 3, 2007 #2


    Staff: Mentor

    Hi Dezo,

    Welcome to physics forums.

    I am not sure that I understand your question. Are you trying to have the ball spin in a different direction than it rolls, e.g. putting some backspin on it so that it rolls back after striking the next ball? Or are you simply trying to convert from e.g. 2 m/s at 30º to a certain vx and vy?
  4. Dec 4, 2007 #3
    No, imagine that for example vx=15 nad vy=10 (whatever units). Now I can say, that in x direction it has rotated by 45 degrees and in y direction by 30 degrees. Now I want to paint the ball. If I rotate it by 45 degrees along the y axis and THEN by 30 degrees along x axis, the final rotation is not correct. So I need some equations that will combine these TWO rotations into ONE (with correct result).
  5. Dec 4, 2007 #4


    User Avatar
    Gold Member

    Why do you think someone will give you a method that doesn't work ?

    Anyhow, you can always rotate your axes so that Vy = 0 in the new frame.

    The angle is [tex]\theta = tan^{-1}(v_y/v_x)[/tex].

    Now calculate the rotation of the ball, then rotate through -theta to get back to the table frame.
  6. Dec 4, 2007 #5


    Staff: Mentor

    There may be some confusion in your setup. You are talking about a game of pool, right? In a game of pool you want to keep the ball on the table. If you rotate about the x or y axis you will wind up with the ball above or below the table. The only axis that you will ever rotate about is the z axis. The axis of rotation is always perpendicular to the plane of rotation.
  7. Dec 4, 2007 #6


    User Avatar
    Gold Member

    Hi Dalespam,
    some confusion of rotations here. I think the OP is talking about the rotation of the ball around its own center. You refer to a rotation of the reference frame, which as you say is always around the z-axis as in my suggestion above.
  8. Dec 5, 2007 #7
    This sounds like a classic little app. Okay, I'm no expert, but I do have a few thoughts:

    I'd say you'll want to have parameters not only for velocity [v(x),v(y)] but also spin [s(x),s(y),s(z)] Heck, you may even want v(z) in the case of the ball bouncing up or being hit with extremely low english. If you incorporate spin, you'll want to derive the amount of friction between the ball & the felt. (Perhaps you could test this with some real-life experimentation!) Add some 'collision' code, & you're most of the way home.
  9. Dec 9, 2007 #8
    Hi guys,
    thanks for ideas.

    I don't want to blame anyone for giving a method that doesn't work. I only wanted to say, that MY solution wasn't right.
    Your method must work, definitely. But imagine the following situation: Let's have a dot on the ball. The "default" rotation of the ball is when the dot is up. Now the ball starts to roll and comes to the wall (-> collision). It hits the wall when the dot is down, so along its movement it made a rotation of 180 degrees. Now the ball rolls in different direction (after collision with wall). If I would compute the rotation with your method, I would get a wrong result, because the starting frame would be "a dot is down".

    Sorry, I exchanged the z and y axis.
  10. Dec 9, 2007 #9


    User Avatar
    Gold Member

    OK, I understand now what you meant.

    You are trying to do a very difficult calculation here, and it can be simplified by rotating your frame, is all I said. I haven't prescribed any 'method'. You are working 3 dimensions because the dot on the ball can move up and down. I wish you well with it.

  11. Dec 9, 2007 #10
    when u said that it is moving along with the x and y axes, did u mean that it was in the top view? I dont understand when you said that it rotated in the y direction (did you meant that i rolled forward) and rotated in the y direction (rolled sideward?). If you are using two vectors (x, y), you can use this:
    xfinal = x * cos(theta_y)
    yfinal = y * cos(theta_x)
    where theta_y is the rotation along the y-axis and theta_x is the rotation along the x-axis.

    If this doesn't fix ur problem, you maybe suffering from gimbal lock. Gimbal lock happens when you rotate along one axis, then try to rotate along another. This results to wrong motion or no motion at all.

    One way out of this is by using quaternions (this may be too advance). I can't post how you can do rotations using quaternions because the math is somehow complex since quaternions deal with complex numbers. But if you learn how to use quaternion rotation, it may become intuitive to use it rather than the usual axis-angle rotation method.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Rotating a pool ball
  1. Rotational ball (Replies: 5)