#include<iostream>
#include<cstdio>
using namespace std;
void main()
{
int n;
double x1,x2,x3,y1,y2,y3,a,b,c,k,m,area;
cin>>n;
while(n--){
cin>>x1>>y1;
cin>>x2>>y2;
cin>>x3>>y3;
a=(y2-y1)/((x1-x2)*(x1-x2));
b=-2*x1*(y2-y1)/((x1-x2)*(x1-x2));
c=y1-x1*x1*(y2-y1)/((x1-x2)*(x1-x2))+2*x1*x1*(y2-y1)/((x1-x2)*(x1-x2));
k=(y3-y2)/(x3-x2);
m=y2-(y3-y2)/(x3-x2)*x2;
area=(a*x3*x3*x3/3+(b-k)*x3*x3/2+(c-m)*x3)-(a*x2*x2*x2/3+(b-k)*x2*x2/2+(c-m)*x2);
printf("%.2lf\n",area);
}
}
posted on 2010-08-10 10:29
付翔 阅读(1409)
评论(0) 编辑 收藏 引用 所属分类:
ACM 数据结构