Курсовая работа: Система обработки научных данных
cin>>choice6;
switch(choice6)
{
case 2:
{
for(i=0;i<n;i++)
{
z1 += a[i];
z2 += b[i];
z3 += a[i]*b[i];
z4 += pow(a[i],2);
z5 += pow(b[i],2);
}
float mex = z1/n;
float mey = z2/n;
float cyx = ((z3/n) - mex*mey);
float vx = ((z4/n) - pow(mex,2));
float vy = ((z5/n) - pow(mey,2));
aa = cyx/vx;
bb = mey - mex*aa;
cout<<"\n\n\n a = "<<aa<<"\t b ="<<bb<<endl;
getch();
clrscr();
initialize();
settextstyle(7,HORIZ_DIR,0);
outtextxy(50,30,"BEST CURVE FIT DIAGRAM");
line(50,400,600,400);
line(50,400,50,50);
outtextxy(556,410,"x");