1021 : The Area of a Sector
时间限制Time Limit
1
秒Sec
内存限制Memory Limit
128
兆MB
提交次数Submitted
1 次Times
通过次数Solved
1 次Times
特判评测 Special
读写方式与标准评测相同。答案可能不唯一,是否正确由本题的特判程序判定,输出格式以题面为准。
I/O is the same as standard judge. Several outputs may be valid; this problem’s special judge decides correctness. Follow the output format in the statement.
| 输入Input | 标准输入。Standard input. |
|---|---|
| 输出Output | 标准输出,格式以题面为准。Standard output; format as specified in the statement. |
题目描述Description
Given a circle and two points on it, calculate the area of the sector with its central angle no more than 180 degrees.
输入格式Input
There are multiple test cases.
Each line contains 6 float numbers denote the center of the circle xc, yc, the two points on the circle x1, y1 and x2, y2.
1 <= xc, yc, x1, y1, x2, y2 <= 10000.
输出格式Output
The area of the sector. The result should be accurated to three decimal places.
样例Sample
提示Hint
With math.h, you could define pi (3.1415926...) as const double pi = acos(-1.0);
Inverse trigonometric function could be obtained by acos, atan, asin, etc..
Be careful that angles like pi in C/C++ are in 3.1415926... type rather than 180.
You’d better use double instead of float. Load double with "%lf" but output it with "%f".
出题Author
CSGrandeur