#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int T;
    double x1,x2,x3,y1,y2,y3,a,b,c;
    cin>>T;
    while(T--)
    {
        scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
        double k=(y3-y2)/(x3-x2);
        double h=y2-k*x2;
        if(k==0)
        {
            b=(2*y1)/x1;
            a=-b/(2*x1);
            c=0;
        }
        else
        {
            a=(y3-y2)/(x3*x3-x2*x2-2*x1*x3+2*x1*x2);
            b=-2*a*x1;
            c=y1-a*x1*x1-b*x1;
        }
        double i=(a*x3*x3*x3)/3.0+(b*x3*x3)/2.0+c*x3-(k*x3*x3)/2.0-h*x3;
        double j=(a*x2*x2*x2)/3.0+(b*x2*x2)/2.0+c*x2-(k*x2*x2)/2.0-h*x2;
        double s=i-j;
        printf("%.2lf\n",s);
    }
}

 

相关文章:

  • 2022-01-01
  • 2022-01-01
  • 2021-07-13
  • 2021-08-19
  • 2021-04-19
  • 2021-10-26
  • 2021-05-20
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2021-12-03
  • 2021-11-21
  • 2021-07-04
  • 2021-07-15
  • 2021-12-05
相关资源
相似解决方案