Determining relative velocities on impact?
- by meds
I'm trying to figure out a way to determine the relative velocity of a body colliding with another in a 2D environment.
For example if one body is moving at (1,0) and another traveling behind it collides with it from behind at (2,0) the velocity of the impact relative to the first body was (1,0).
I need a method which takes in two velocities, one velocity belonging to the body the velocity is being measured against, and the other for the impacting body and return the relative velocity.