微积分,对题目图片中最小的那个三角求积分
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
const double PI = acos(-1.0);
const double seven = sqrt(7.0);
const double a = asin((5.0 - seven)/8.0);
const double b = asin((1.0 - seven)/4.0);
int t; scanf("%d", &t);
while (t--) {
double n; scanf("%lf", &n);
double s1 = 3.0 / 2.0 * n * n - 3.0 / 8.0 * PI * n * n;
double s2 = n * n * (sin(a) - 1.0/4.0 * sin(2 * a) - 1.0/2.0 * a) - (n * n) / 4.0 * (sin(b) - 1.0/4.0 * sin(2 * b) - 1.0 / 2.0 * b);
printf("%.2lf\n", s1 - 4.0 * s2);
}
return 0;
}