$begingroup$

I’m attempting to determine the speed of ball A after collision which is V2.A as seen within the determine. I do know that the speed of ball A when collision happens is perpendicular to the road connecting centre of ball A and B when the collision happens.

enter image description here
(Picture taken from: http://www.real-world-physics-problems.com/physics-of-billiards.html)

Challenge is, my V2.A is usually flipped in other way, and I am unable to appear to determine the problem right here. This is my V2.A calculation

Vector2 diff = (b - a).normalized;  
Vector2 perpendiular = Vector2.Perpendicular(diff);

Thanks!

$endgroup$

$begingroup$

See Vector2.Perpendicular:

Returns the 2D vector perpendicular to this 2D vector. The result’s at all times rotated 90-degrees in a counter-clockwise path for a 2D coordinate system the place the constructive Y axis goes up.

On this case, simply decide whether or not the unsigned angle between the speed vector of ball A and the end result vector is larger than 90 levels:

Vector2 diff = (b - a).normalized;
Vector2 perpendiular = Vector2.Perpendicular(diff);
if (Vector2.Angle(directionOfA, perpendiular) > 90)
{
    perpendiular = -perpendiular;
}

$endgroup$

You could log in to reply this query.

Not the reply you are in search of? Browse different questions tagged .