RainAir
My OI Blog
TCO2017 Round 1A PolygonRotation

题目描述

We have a convex polygon in the XY plane. The vertices of the polygon are the points (x[0], y[0]), (x[1], y[1]), … in clockwise order. You are given the vector s x and y.

In order to make the implementation simpler the polygon and its representation satisfy some additional constraints. Please read the Constraints section carefully.

A three-dimensional solid is obtained by rotating this polygon around the Y axis. Compute and return the volume of the resulting solid.

题目大意

1. 在 y 轴上恰好有两个点
2. 设在 y 轴上的两个点分别是 $(0,y_{min})$ 与 $(0,y_{max})$，其中 $y_max > y_min$，那么其 他所有点的 $y$ 坐标都介于 $[y_{min},y_{max}]$ 之间
3. 没有重点，没有三点共线

解题报告

(为了不用科学上网，我把和这题有关的内容搬过来)：
“If the function to be revolved is a function of x, the following integral represents the volume of the solid of revolution:
$$\pi \int_{a}^{b} R(x)^2 dx$$
where $R(x)$ is the distance between the function and the axis of rotation. This works only if the axis of rotation is horizontal (example: $y = 3$ or some other constant).”

一些 Simple 的问题

$$\int_{a}^b f(x)dx = \sum_{i = 2}^n \frac{\Delta x}{3}(y_{n-2}+4y_{n-1}+y_n)$$

推荐文章

• Qingyu

Orz wyh又爆切神仙题了

7月前回复
• Logey

tql

7月前回复

RainAir

TCO2017 Round 1A PolygonRotation

2019-06-09