Lawn bowls maths help (I have the formula, I want to rotate it)

Started by
0 comments, last by julesgg 22 years, 8 months ago
Hi Im writting a bowls game. With some help from reseachers and research papers I have the formula to plot the path of a lawn bowl It goes a# = acceleration (well its deceleration in y axis) u# = initial speed b# = bowls bias (force on the bowls x axis) t# = time so you get first derivative = acceleration in y direction at t# = -a# second derivative = velocity in y direction at t# = u# - a#*t# y position at t# = u#*t# - 0.5*a#*t#^2 first derivative = acceleration in x direction at t# = b# second derivative = velocity in x direction at t# = b#*t# x position at t# = 0.5*b#*t#^2 Now by using fixed values of u# = 4 a# = 0.3813 b# = 0.0404 You get a accurate representation of a bowls path, when plotting x and y positions on a graph. My question is that the graph shows the bowl being aimed straight. What alterations to the positional formulas do I have to make so I can choose a diffrent aiming line, but get the same results. I dont want to change the shape of the graph I want to rotate it to a desired angle. eg if straight up produced A) I want to be able to say the aim liune = 45 degrees and produce B). A) B) | * | * | * | * | * | * |* | * |* | * |* | * ----- ---------- Hope thats all clear.
Advertisement
Your A/B diagram is a bit confusing, since I don''t see that B is 45 degrees away from A....

Also, there is an error in your terminology:

first derivative = acceleration in y direction at t# = -a#second derivative = velocity in y direction at t# = u# - a#*t#y position at t# = u#*t# - 0.5*a#*t#^2 

Your derivative equations look correct, but velocity is the first derivative (not second) and acceleration is the second derivative (not first). I think you just wrote it wrong. The same comment applies to the x direction equations.

Also, the thing you''re calling bowls bias (force on the bowls x axis), b#, is NOT a force! Its an acceleration, just like a#.

But I gather that you''re really just looking to rotate the bowl''s path, which can be done by just geometrically rotating the points generated by your existing code. Its rather simple, just a matrix transformation:

    [cos(angle)    -sin(angle)]R = [sin(angle)     cos(angle)] 


where angle is the angle of rotation, measured counterclockwise from y. So, angle = 0 is for y in its initial position. angle = 45 degrees is 45 degrees to the right of y''s straight ahead position, angle = 90 degrees is 90 degrees to the right of y''s straight ahead position.

To use R, do this:

                     [x_new]rp = rotated point = [y_new]                       [x]gp = generated point = [y] = point from your physics              [x*cos(angle) - y*sin(angle)]rp = R * gp = [x*sin(angle) + y*cos(angle)]Or, just:x_new = x*cos(angle) - y*sin(angle)y_new = x*sin(angle) + y*cos(angle) 



NOTE: My definition of angle here is different than the typical computer graphics definition, and so the rotation matrix R looks different than in a textbook. I defined angle for convenience in this problem.

Hope this answers your question.

An alternative way to do this would be to rotate the ball''s acceleration vector by angle, but it would complicate things a bit. You''d have to introduce a term like u# into the x direction equation as well.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement