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

image.png

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

More By Author:

Check out these other kata created by zhangjunyan2580

Stats:

CreatedDec 18, 2021
PublishedDec 18, 2021
Warriors Trained121
Total Skips39
Total Code Submissions104
Total Times Completed18
C++ Completions18
Total Stars9
% of votes with a positive feedback rating75% of 10
Total "Very Satisfied" Votes7
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes2
Total Rank Assessments9
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • zhangjunyan2580 Avatar
  • Welpy Avatar
Ad