送 分 证 明 题
Seauy
·
·
个人记录
1. 问题描述:
在一个欧里几德平面上,有两条线段,它们的中点重合且长度相等。求证当它们的夹角 \theta = 90 \degree 时,端点所形成的矩形面积最大,且 \theta 越小,矩形面积越小。
2. 证明
设两条线段长度的一半为 a
则矩形的面积可以表达为
S=\frac{1}{2}(a^2 \sin \theta + a^2\sin (180 \degree-\theta))
很容易看出来让 \sin \theta + \sin (180 \degree - \theta) 最大就行了
众所周知 \sin \theta = \sin (180\degree - \theta)
那么 \sin \theta + \sin (180 \degree - \theta)=2 \sin \theta
\because \sin \theta \leq 1
\therefore \sin \theta + \sin (180 \degree - \theta) $ 的最大值为 2,当且仅当 $ \sin \theta =1
而且 $ \sin \theta $ 在 $ [0,90\degree] $ 之间单调递增,得证
# 3. 应用
~~这么简单的问题证明也这么短,有啥用嘞~~
其实可以用来优化 [[HNOI2011]数矩形](https://www.luogu.com.cn/problem/P3217)
当长度和中点相同的线段被归为一类之后,不用 n 方地枚举所有组成矩形的情况,再按线段与 x 轴的夹角排序,快速找到与当前线段所称夹角最接近 $ 90 \degree $ 的线段就行了
复杂度从 $ O(n^2 \sqrt{n}) $ 优化到 $ O(n^2 \log n) $ 了
~~其实从优化复杂度的角度来看,常数大一点可能还会变慢,代码还会更难写。但是可以不用证明暴力枚举复杂度为 $ O(n^2 \sqrt{n}) $ 了~~