标签:
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<cmath>
#include<stdio.h>
using namespace std;
int main()
{
double a, b, x, y;
int n;
scanf("%d", &n);
while (n--)
{
scanf("%lf%lf%lf%lf", &a, &b, &x, &y);
if (y < 0)
y = -y;
double s, angle;
if (abs(y - 0.00) < 1e-5)
{
printf("%.2f\n", 0.00);
continue;
}
double temp = y * 1.0 / x;
angle = atan(temp);
double l1, l2;
l1 = a;
double k = y * 1.0 / x;
double x = (a*a*b*b) / (b*b + k*k*a*a);
x = sqrt(x);
l2 = x *1.0/ (cos(angle));
s = 0.5 * l1 * l2 * angle;
printf("%.2f\n", s);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/icode-girl/p/4668116.html