Tambang wrote:
> Here's a common problem with a tricky complication.
>
> A 20 x 20 square is struck by a 5 diameter circle travelling on a
> vector with components x and y.
> We know the x-y coordinates of the center of the ball, center of the
> square and rotation of the square.
> We also know the x and y components of the vector.
> The zero angle of rotation is straight up.  The 0,0 point is top left.
> x increases to the right and y increases downwards.
>
> What would be the resulting bounce vector when the ball hits the
> square?
>
> The trick is when you see that a horizontal hit at a 45 degree rotation
> will give a bounce upwards if the strike is above the center or
> downwards if it is below the center.
> I need a really tight algorithm to calculate the bounce vector no
> matter what the ball or square coordinates are, or the impact vector
> is.
>
> Good luck!

If you are talking about perfectly elastic and frictionless collision,
then bouncing from the corner of a rotating square is identical to
bouncing from a flat surface tangent to the ball at the point of
impact.  Since the square is rotating, you want to do the bounce
calculation in its reference frame.  The equations for bouncing from a
surface are in lots of textbooks.  What's the trick in that?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to