#include <iostream>
#include <string.h>
#include <cmath>
#include <stdio.h>
using namespace std;
struct point
{
double x,y;
};
point p1,p2,p3;
double a,h,l,k,b;
double f (double x)
{
return a*x*x*x/3 - (a*h + k/2)*x*x + (a*h*h+l-b)*x;
}
int main ()
{
int cases;
scanf ("%d",&cases);
while (cases--)
{
scanf ("%lf %lf",&p1.x,&p1.y);
scanf ("%lf %lf",&p2.x,&p2.y);
scanf ("%lf %lf",&p3.x,&p3.y);
k = (p3.y - p2.y) / (p3.x - p2.x);
b = p3.y - k*p3.x;
h = p1.x;
l = p1.y;
a = (p2.y - l)/((p2.x - h)*(p2.x - h));
printf ("%.2lf\n",f (p3.x) - f (p2.x));
}
return 0;
}
hdu 1071定积分
最新推荐文章于 2014-06-07 00:31:22 发布