Beta
Circle
Description:
Description
A chord divides a circle into two arches with an area ratio of 1:X. Please find the central angle of this chord.
Implementation Details
You should implement the following functions:
double circle(double X); // (1)
(1) The argument X
is the ratio. It should return the central angle in radians.
Note that a chord has two central angles. Return the smaller one.
See sample test 2 for more info.
Constraints
1 <= X <= 10^3
Examples
(1) The argument X
is the ratio. It should return the central angle in radians.
Test Cases:
3*10^6 random tests.
Sample Explanation
The ratio of the area of arch BCB' to the area of another arch is approximately equal to 265.2504701351.
Since the angle BAB' is pi/6 in radians, the answer is pi/6.
Algorithms
Similar Kata:
Stats:
Created | Dec 18, 2021 |
Published | Dec 18, 2021 |
Warriors Trained | 121 |
Total Skips | 39 |
Total Code Submissions | 104 |
Total Times Completed | 18 |
C++ Completions | 18 |
Total Stars | 9 |
% of votes with a positive feedback rating | 75% of 10 |
Total "Very Satisfied" Votes | 7 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 9 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |