Hi Guys,
The above picture shows my approach for this problem https://mirror.codeforces.com/contest/1354/problem/C1
Am basically using the interior angle subtended by 3 adjacent vertices and then to find the vertical ( perpendicular ) line's length using tan function
But am getting completely unexpected answer.
// -- MY CODE :
long double n;
cin >> n;
// long double angle = (((180 * (2*n — 2)) / (2*n) ) / 360) * 2 * 3.14
long double angle = ((((n — 1)) / n)) * 3.14;
cout << tan(angle) << endl;
PLEASE GUYS HELP ME FIND MY MISTAKE .
THANKS IN ADVANCE.