I posted this on a programming forum as well, as that's the end result of this problem. But here is where I'm at; am I correct so far?
I'm working on the math now. And this is what I have, am I on the right track?
Ball 1 has mass M1 and is at p1=[2,5] with v1 = [-1,0], ball 2 has mass M2 and is at p2=[4,1] with v2=[1,0]. Let's assume ball 1 is 3 meters and ball 2 is 2 meters (So they're colliding). Then that means the angle between the velocity of ball 2 vector and the line between the two balls is
x1 = cos theta1 = v1.(p1-p2)/root((v1.v1 * (p1-p2).(p1-p2))).
And the angle between the velocity of ball 1 vector and the line between the two balls is
x2 = cos theta2 = v2.(p2-p1)/root((v2.v2 * (p2-p1).(p2-p1))).
And so the portion of the velocity vector perpendicular to that angle is the same before and after the collision. Right? So
||v1i|| * x1 = ||v1f|| * x1
||v2i|| * x2 = ||v2f|| * x2
And since x = cos theta, sin theta =
root(1-x{1,2}^2) = y{1,2}
And M1 * || V1i || * y1 + M2 * || V2i || * y2 = M1 * || V1f || * y1 + M2 * || V2f || * y2
Am I right so far? Now I have 1 equation for 2 unknowns, do I use KE for the other equation? I assume I break up the KE equations as well along my theta1, theta2?
(Sorry, It's been almost 5 years since I've taken mechanical physics. And I hope you can read my equations)