Answer the question
In order to leave comments, you need to log in
What physics formula does this code look like?
float
v1xp = b1.vx,
v1yp = b1.vy,
v2xp = b2.vx,
v2yp = b2.vy,
r = b1.r+b2.r;
b1.vx = (float) (v1xp * Math.pow((b2.y-b1.y)/r,2) + v2xp * Math.pow((b1.x-b2.x)/r,2) + v1yp * (b2.x-b1.x)*(b1.y-b2.y)/Math.pow(r,2) + v2yp * (b2.x-b1.x)*(b2.y-b1.y)/Math.pow(r,2));
b1.vy = (float) (v1xp * (b2.y-b1.y)*(b1.x-b2.x)/Math.pow(r,2) + v2xp * (b2.y-b1.y)*(b2.x-b1.x)/Math.pow(r,2) + v1yp * Math.pow((b2.x-b1.x)/r,2) + v2yp * Math.pow((b1.y-b2.y)/r,2));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question