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));