void __fastcall TForm1::Button1Click(TObject *Sender)
{
double x,y;
double v,phi;
Series1->Clear();
for (int i=0; i<=Edit3->Text; i++)
{
v= StrToFloat(Edit1->Text);
phi=StrToFloat(Edit2->Text)*3.14/180;
x=v*cos(phi)*i;
y=v*sin(phi)*i-4.9*i*i;
StringGrid1->Cells[1][i+1] = x;
StringGrid1->Cells[2][i+1] = y;
if(y<0)
break;
Series1->AddXY(x,y,clRed);
Application->ProcessMessages();
Sleep(200);
x=0;
y=0;
StringGrid1->RowCount++;
}
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
double xx1=0,yy1=0;
double xx2=0,yy2=0;
xx1=StrToFloat(StringGrid1->Cells[1][1]);
yy1=StrToFloat(StringGrid1->Cells[2][1]);
xx2=StrToFloat(StringGrid1->Cells[1][2]);
yy2=StrToFloat(StringGrid1->Cells[2][2]);
Image1->Canvas->MoveTo(xx1,yy1);
Image1->Canvas->LineTo(xx2,yy2);
for (int j=3; j<=StringGrid1->RowCount-5; j++)
{
Sleep(200);
Application->ProcessMessages();
Image1->Canvas->Pen->Color = clWhite;
Image1->Canvas->MoveTo(xx1,yy1);
Image1->Canvas->LineTo(xx2,yy2);
Image1->Canvas->Pen->Color = clWhite;
xx1=xx2;
yy1=yy2;
xx2=StrToFloat(StringGrid1->Cells[1][j]);
yy2=StrToFloat(StringGrid1->Cells[2][j]);
Image1->Canvas->Pen->Color = clBlack;
Image1->Canvas->MoveTo(xx1,yy1);
Image1->Canvas->LineTo(xx2,yy2);
}
}
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.