Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calculating new trajectory vector in 2D


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 noatom   Members   -  Reputation: 782

Like
0Likes
Like

Posted 29 September 2012 - 03:19 PM

So suppose I have this:


A ball and a paddle.
The ball comes at the paddle with a certain speed,and at some point,the ball will hit the paddle.After that,the ball will be reflected to a new position,I need to calculate that new position vector where the ball will have to go after it hits the paddle.

I already have the equation,but because my math is very bad,I don't really understand it.
Can someone explain every part of it,why it's needed,and how it works? Like why do we use the dot product?

Here it is:

//calculate rebound vector® from normalized difference in position(p) and ball's velocity(v),

//and considering forward(f) and paddle velocity(u):
r = p * (1 - dot(p, f) + len(v)) + u

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS