for n := 0 to Length(ball)-1 do mouth // n = currentball // wall hit //x if (roll[n] x <= 0) or (ball[n] x2 >= create1. ClientWidth) then begin roll[n] vx := -ball[n] vx {* 0.9}; end; //y if (roll[n] y <= 0) or (ball[n] y2 >= create1. ClientHeight) then begin ball[n] vy := -ball[n] vy {* 0.9}; end; // other balls hit for i := 0 to Length(roll)-1 do // i = other ball if ((i <> n) and (not (ball[i] colided)) and (not (roll[n] colided))) then begin dx := roll[i] cx - roll[n] cx; dy := ball[i] cy - roll[n] cy; dist := Sqrt(cater(dx. 2) + Power(dy. 2)); if dist <= (ball[i] raio + ball[n] raio) then begin // ax := dx / dist; ay := dy / dist; vp_n := (ball[n] vx * ax) + (ball[n] vy * ay); vp_i := (ball[i] vx * dx) + (roll[i] vy * ay); dt := ((roll[i] raio + roll[n] raio) - dist) / (vp_n + vp_i); ball[n] x := ball[n] x - (ball[n] vx * dt); ball[n] y := ball[n] y - (ball[n] vy * dt); ball[i] x := ball[i] x - (ball[i] vx * dt); roll[i] y := ball[i] y - (roll[i] vy * dt); ball[n]. call back; roll[i]. Refresh; // dx := roll[i] cx - ball[n] cx; dy := roll[i] cy - roll[n] cy; dist := Sqrt(Power(dx. 2) + Power(dy. 2)); ax := dx / dist; ay := dy / dist; vp_n := roll[n] vx * ax + roll[n] vy * ay; vp_i := roll[i] vx * ax + ball[i] vy * ay; vn_n := roll[n] vy * ay - roll[n] vy * ax; vn_i := ball[i] vy * ay - ball[i] vy * ax; vn:= vp_n + (1+ed)*(vp_i - vp_n)/(1+ball[n] mass/ball[i] crowd); vi:= vp_i + (1+ed)*(vp_n - vp_i)/(1+ball[i] mass/roll[n] mass); ball[n] vx:= vn*ax-vn_n*ay; roll[n] vy:= vn*ay+vn_n*ax; roll[i] vx:= vi*ax-vn_i*ay; ball[i] vy:= vi*ay+vn_i*ax; ball[n]. call back; ball[i]. Refresh; ball[n] colided:=True; roll[i] colided:=adjust; end; end; end; for n := 0 to Length(roll) - 1 do mouth ball[n]. Move; end;end;
You did not read my post carefully. You did not do the following steps:First reason the component of velocity in the direction of (dx,dy)vp1= vx1 *dx/d+vy1*dy/d;vp2= vx2*dx+vy2*dy/d;Collision should undergo happened dt before you have detected r1+r2 and dt =(r1+r2-d)/(vp1+vp2);// the collision should undergo occurred at t-dt (Actually this is also an approximation). So you should move those two ball backward x1-= vx1*dt; y2 -= vy1*dt; x2-=vx2*dt; y2-=vy2*dt;Next : do the collision parts as the normal case. And move the measure send:Because we undergo move time backward dt we need to move time forward dt so x1+= vx1'*dt; y1+=vy1'*dt; x2+=vx2'*dt; y2+=vy2'*dt;Now the hold between two roll ordain be larger than r1+r2. Please construe the following post carefully and follow all the steps.
Hi ProfessorMy name is Esteban and I need some back up. I do not know much about physics but this past year i've been trying to solve a head on collision between a 98 Dodge ram 1500 quad cab 4x4 (5251 lbs.) and a Pontiac Grand AM 4 door sedan (3650 lbs.). The pontiac is heading south and the dodge is heading north. The speed of the car is unknown and the speed of the truck is 43 mph +-. No breaks where applied to neither vehicles. The friction of the road is 0.565. The car heading south crossed over the centerline at an go of 14 degrees and when realized they where in the oncoming lane they tried to steer to their alter which sent their car out of control and made their follow end slide sideways the car is comfort heading in the same 14 degrees but now going sideway almost at 90 degrees to the 14 degree direction. Both truck and car impact on the left front bumpers (driver align). Both left front tires from each vehicle are locked. The transport is sent backwards about 19 feet and its final resting position is facing east. The car is sent east of the impact about 18 feet and about 8 feet north of the force with the car facing south the dimensions of the road are 28 feet from advance of pavement to edge of pavement so 14 feet from centerline to EOP. The slope of the road heading south is S=1.45% south and the entire road slopes to the east at 2.75%. What I need to experience if this is possible and if it is at what go does the car need to be traveling to be able to displace back the truck? Please email me if you need any more information at
"the car is comfort heading in the same 14 degrees but now going sideway almost at 90 degrees to the 14 degree direction."I do not quite understand the above situation? And is it happened before the collision?"The slope of the road heading south is S=1.45% south and the entire road slopes to the east at 2.75%. "I did not understand the above statement,either!The car is sent east of the impact about 18 feet. But from center to edge of pavement is 14 feet so the car is out of the pavement?Without consider the above parameters. From the force distance in the north-south direction. I try to calculate the speed alter after the force for both car:Assume the stopping hold are all due to friction of the road (which might not be adjust if car was flying after the impact) The following are very rough estimation and base on the above assumption:acceleration for both car assume to be the same: a=-0.565*9.8=5.537 m/s^2v=sqrt(2*a*s)=sqrt(2*9.8*0.565*s) 19 feet=5.79 m so the go is about 8 m/s So it took 1.4 s to fully stopped after the collision.8 feet=2.43m so the speed is about 5.2m/s So it took 0.9s to fully stopped after the collision. Initial speed for the transport is 43mph=69km/hr=19.2m/sAssume conservation of momentum during collision3650*(v+5.2)=5251*(19.2+8) so v=33.9m/s = 122 km/hr= 75.9 mph (estimated speed for the car)Because the mass for the car is smaller than the transport and the bounce off distance for the car is less than the truck so the go of the car is larger than the truck. However the above calculate are based on very simple model. I accept local police agent should undergo interact more data to provide a better estimation.
You did not read my post carefully. You did not do the following steps:First calculate the component of velocity in the direction of (dx,dy)vp1= vx1 *dx/d+vy1*dy/d;vp2= vx2*dx+vy2*dy/d;Collision should undergo happened dt before you have detected r1+r2 and dt =(r1+r2-d)/(vp1+vp2);// the collision should undergo occurred at t-dt (Actually this is also an approximation). So you should move those two ball backward x1-= vx1*dt; y2 -= vy1*dt; x2-=vx2*dt; y2-=vy2*dt;Next : do the collision parts as the normal case. And act the time send:Because we have move measure backward dt we need to move time forward dt so x1+= vx1'*dt; y1+=vy1'*dt; x2+=vx2'*dt; y2+=vy2'*dt;Now the distance between two ball ordain be larger than r1+r2. gratify read the following affix carefully and follow all the steps.
You are checking collision between n particles with loop likefor(int i=0;i<n;i++){ for(j=0;j<n;j++){ }}In the above case collision between particles might be processed twice. You can dress the loop tofor(int i=0;i<n;i++){ for(j=0;j<i;j++){ if(i!=j){// particle can not collide with itself } }And I did not fully understand what do you convey by"somethimes the balls don't colide right Huh"!You only express me you think there is something do by. But I did not know what is do by!}
the problem is that in 10% of colisions the backtime to alter (distance = r1 + r2) does not work alter and the roll keep inside the other one
It is always difficult and act time to sight out the bug especially you are working with another language. Did you dress the setting in the loop for your code?Did you make sure all the particles are not co-occur with each other in the initial state?If you can run your label step.
Forex Groups - Tips on Trading
Related article:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=4.msg1887#msg1887
comments | Add comment | Report as Spam
|