21679_CollisionDetection

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

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

Pro.ID

21679

Title

Collision Detection

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    In physical simulations, video games and computational geometry, collision detection involves algorithms for checking for collision, i.e. intersection, of two given objects. Collision detection algorithms are a basic component of 3D video games. Without them, characters could go through walls and other obstacles.

    Here comes an interesting problem, given a ball and a cuboid, you need to detect whether they collide. We say that two objects collide if and only if they share at least one point.

    输入

    The first line of input is the number of test cases.

    Each test case contains two lines, the first line contains 24 integers X1, Y1, Z1, …, X8, Y8, Z8, representing the 8 vertexes of the cuboid. Vertexes are given in random order and you can make sure that all edges of the cuboid are parallel to coordinate axes; the second line contains 4 integers X, Y, Z, R representing the central point of the ball and its radius. All integers given are non-negative and will be less than 100000.

    输出

    Description

    In physical simulations, video games and computational geometry, collision detection involves algorithms for checking for collision, i.e. intersection, of two given objects. Collision detection algorithms are a basic component of 3D video games. Without them, characters could go through walls and other obstacles.

    Here comes an interesting problem, given a ball and a cuboid, you need to detect whether they collide. We say that two objects collide if and only if they share at least one point.

    Input

    The first line of input is the number of test cases.

    Each test case contains two lines, the first line contains 24 integers X1, Y1, Z1, …, X8, Y8, Z8, representing the 8 vertexes of the cuboid. Vertexes are given in random order and you can make sure that all edges of the cuboid are parallel to coordinate axes; the second line contains 4 integers X, Y, Z, R representing the central point of the ball and its radius. All integers given are non-negative and will be less than 100000.

    Output

    For each case output "Yes" Or "No" on a single line.

    Sample Input

    2
    0 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1
    2 2 2 2
    0 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1
    2 2 2 1

    Sample Output

    Yes
    No

    Source

    样例输入

    2
    0 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1
    2 2 2 2
    0 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1
    2 2 2 1

    样例输出

    Yes
    No

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部