Topic link

Train of thought

I think most of the problems in Logu should be problematic, please correct me if I think wrong, thank you.

In the previous problem I said why
2 PI. 2\pi
Subtract two angles to get a third Angle because of the error. But that’s not true. For the 13th test point, I drew a picture to measure the three angles and calculate the sine value, which was almost the same as the result of the program running, but it was not possible to calculate directly when doing the problem. Let’s use the following figure (test point 13) as an example:



In the work out
< A O B < AOB
and
< A O C < AOC
And then, the previous problem
2 PI. < A O B < A O C 2 \ PI – < AOB – < AOC
To calculate the
< B O C < bok
The value of the. But what you get is not real
< B O C < bok
The value of, but will
C C
about
O A OA
And then after symmetry
C C’
(Because it’s a regular polygon, so this
C C’
Must exist), get
< B O C < BOC ‘
The value of theta is significantly higher than the original value
< B O C < bok
Bigger, three angles
g c d gcd
It’s bigger (I don’t know why, and there’s no explanation online).

code

#include<bits/stdc++.h>
#definerep(i,st,ed) for(ll i=st; i<=ed; ++i)
using namespace std;
typedef long long ll;
typedef double db;
const db pi=acos(- 1);
db x[5],y[5],d[5] [5];
struct Line{
	db k,b;
};
db dis(db x1,db y1,db x2,db y2)
{
	return sqrt(pow(x1-x2,2) +pow(y1-y2,2));
}
db fgcd(db a,db b)
{
	if(fabs(a0.0) <1e-2)
		return b;
	if(fabs(b0.0) <1e-2)
		return a;
	return fgcd(b,fmod(a,b));
}
int main(a)
{
	rep(i,1.3)
		scanf("%lf%lf",x+i,y+i);
	rep(i,1.3)
		rep(j,i+1.3)
			d[i][j]=dis(x[i],y[i],x[j],y[j]);
	db KAB=(y[1]-y[2])/(x[1]-x[2]);
	db KAC=(y[1]-y[3])/(x[1]-x[3]);
	
	db KAB_=(db)(- 1)/KAB;
	Line AB_={KAB_,(y[1]+y[2) /2-KAB_*(x[1]+x[2) /2};
	db KAC_=(db)(- 1)/KAC;
	Line AC_={KAC_,(y[1]+y[3) /2-KAC_*(x[1]+x[3) /2};
	x[0]=(AB_.b-AC_.b)/(AC_.k-AB_.k);
	y[0]=KAB_*x[0]+AB_.b;
	
	
	db R=dis(x[0],y[0],x[1],y[1]);
	db C_AB=2.0*asin(d[1] [2] /2.0/R);
	db C_AC=2.0*asin(d[1] [3] /2.0/R);
	/ / db C_BC = 2.0 * asin (d [2] [3] / 2.0 / R);
	db C_BC=2.0*pi-C_AB-C_AC;
	//printf("%lf %lf %lf\n",C_AB,C_AC,C_BC);
	
	db Cir=fgcd(fgcd(C_AB,C_AC),C_BC);
	db S=R*R/2.0*sin(Cir);
	db n=2*pi/Cir;
	printf("%.8lf",n*S);
}
Copy the code