QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 512 MB مجموع النقاط: 100

#9343. 阴影

الإحصائيات

众所周知,地球是三维空间中的一个无限平面,而太阳只是一个向各个方向均匀发光的小球,为简单起见,将其表示为三维空间中的一个单点。有一天,死星来了。死星是一个半径为 $R$ 的球体。因为它非常巨大,地球上的某些区域被阴影覆盖了。你的任务是根据地球、死星和太阳的初始位置,计算阴影的面积。

输入格式

第一行给出一个整数 $Z \le 10^4$,表示后续行中描述的测试用例数量。

每个测试用例的第一行包含三个整数 $X_s, Y_s, Z_s$,表示太阳的初始坐标。

第二行包含四个整数 $X_d, Y_d, Z_d$ 和 $R$,表示死星的球心位置和半径。

第三行也是最后一行包含四个整数 $A, B, C$ 和 $D$,表示地球是一个由满足 $Ax + By + Cz + D = 0$ 的点 $(x, y, z)$ 组成的平面。

你可以假设地球、死星和太阳是两两不相交的(它们没有公共点),且答案大于 0 并且不是无穷大。

  • $X_s, Y_s, Z_s \in [-10^4, 10^4]$
  • $X_d, Y_d, Z_d \in [-10^4, 10^4]$,$R \in [1, 10^4]$
  • $A, B, C, D \in [-10^4, 10^4]$

输出格式

对于每个测试用例,标准输出的第一行也是唯一一行应包含一个实数,表示死星在地球上投下的阴影面积。如果相对误差或绝对误差不超过 $10^{-6}$,你的答案将被接受。

样例

输入样例 1

2
0 0 0
0 0 5 3
0 0 5 -50
0 0 0
6 8 0 6
6 8 0 -180

输出样例 1

176.714586764
572.555261117

输入样例 2

1
3 1 2
5 -1 4 2
2 -1 1 -22

输出样例 2

77.432452329

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.