22186_EllipseIntersection

2022-5-16 18:21| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506183679400-Problem List-采集的数据-后羿采集器.html

Pro.ID

22186

Title

Ellipse Intersection

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22186

AC

0

Submit

4

Ratio

0.00%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Recently the astronomers have discovered a peculiar pair of planets, named A and B. As we know, a planet usually moves in an ellipse orbit, so do A and B. But their orbits are quite special:

    (1)  Their orbits are in the same plane and share the same center;

    (2)  The segments formed by joining their own focuses respectively are perpendicular to each other.

    If we denote the center as point O, and the focuses of orbit A as F1, F2, then we can build Cartesian coordinates, with point O being the origin, and the line through F1, F2 being the x-axis.

    Here is a sample as follows:

    Figure 1

    As the astronomers would like to know more about the planets, they decide to calculate the intersection area first. But unfortunately calculating the intersection area is so complex and beyond their ability, so they have to turn to you, a talent of programming. Now your task is: given the description of two ellipse orbits satisfying the conditions above, calculate their intersection area.

    输入

    Input may contain multiple test cases. The first line is a positive integer n ( n ≤ 100 ), denoting the number of test cases below. Each case is composed of two lines, the first one is the description of orbit A, and the second one the description of orbit B. each description contains two positive integers, a, b, ( a, b ≤ 100 ) denoting the ellipse equantion x2/a2+y2/b2 = 1. It's guaranteed that the focuses of orbit A are on x-axis, and the focuses of orbit of B are on y-axis.

    输出

    Description

    Recently the astronomers have discovered a peculiar pair of planets, named A and B. As we know, a planet usually moves in an ellipse orbit, so do A and B. But their orbits are quite special:

    (1)  Their orbits are in the same plane and share the same center;

    (2)  The segments formed by joining their own focuses respectively are perpendicular to each other.

    If we denote the center as point O, and the focuses of orbit A as F1, F2, then we can build Cartesian coordinates, with point O being the origin, and the line through F1, F2 being the x-axis.

    Here is a sample as follows:

    Figure 1

    As the astronomers would like to know more about the planets, they decide to calculate the intersection area first. But unfortunately calculating the intersection area is so complex and beyond their ability, so they have to turn to you, a talent of programming. Now your task is: given the description of two ellipse orbits satisfying the conditions above, calculate their intersection area.

    Input

    Input may contain multiple test cases. The first line is a positive integer n ( n ≤ 100 ), denoting the number of test cases below. Each case is composed of two lines, the first one is the description of orbit A, and the second one the description of orbit B. each description contains two positive integers, a, b, ( a, b ≤ 100 ) denoting the ellipse equantion x2/a2+y2/b2 = 1. It's guaranteed that the focuses of orbit A are on x-axis, and the focuses of orbit of B are on y-axis.

    Output

    For each test case, output one line containing a single real number, the area of the intersection, accurate to three decimals after the decimal point.

    Sample Input

    1
    2 1
    1 2

    Sample Output

    3.709

    Source

    样例输入

    1
    2 1
    1 2

    样例输出

    3.709

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部