There is a body on the form, at the touch of a button it falls. There is an algorithm by which it falls on the surface for a certain time (depends on the height). How can one make the body motion uniformly accelerated and not at a constant speed like now?
procedure TMainForm.StartClick(Sender: TObject); const g = 9.81; var t,h:Double; begin h:=sSpinEdit1.Value; if (h<>0) then begin t:=Sqrt((2*h)/g)*1000;//Π²ΡΡΠΈΡΠ»Π΅Π½ΠΈΠ΅ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ timePX:= (h*8)/(t/10);//ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΏΠΈΠΊΡΠ΅Π»Π΅ΠΉ Π² 10ΠΌΡ end; if (MainForm.shp1.top>=MainForm.img1.Height-42)//ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° Π»Π΅ΠΆΠΈΡ Π»ΠΈ Π½Π° Π·Π΅ΠΌΠ»Π΅ then else tmr1.Enabled:=True; MainForm.sSpinEdit1.Enabled:=False; end; procedure TMainForm.tmr1Timer(Sender: TObject); begin fc:=fc+Frac(timePX);//ΡΠΊΠ»Π°Π΄ΡΠ²Π°Π½ΠΈΠ΅ ΠΎΡΡΠ°ΡΠΊΠΎΠ² ΠΎΡ timePX MainForm.shp1.top := MainForm.shp1.top+Trunc(timePX);//ΠΡΠΈΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΎΠΉ ΡΠ°ΡΡΠΈ timePX if(fc>=1)//ΠΡΠΈΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΎΡΡΠ°ΡΠΊΠ° ΠΎΡ timePX then begin MainForm.shp1.top := MainForm.shp1.top+Trunc(fc); fc:=fc-1; end; if (MainForm.shp1.top>=MainForm.img1.Height-42) then tmr1.Enabled:=False; end;