Recently I've been studying some geometry, and now I want to know the different ways of computing the extremal Points on a set of points for a fixed direction, please leave it in the comments.
Thanks in advance.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Recently I've been studying some geometry, and now I want to know the different ways of computing the extremal Points on a set of points for a fixed direction, please leave it in the comments.
Thanks in advance.
Название |
---|
How?
I know one way to do it. We want the point with maximal projection over a fixed vector. Let's treat points as vectors starting at $$$(0,0)$$$. We know that $$$A \cdot B = |A|\cdot|B|\cdot \cos{\theta}$$$, where $$$\theta$$$ is the angle between $$$A$$$ and $$$B$$$. Well, if $$$B$$$ was the $$$X$$$-axis, then $$$|A|\cdot \cos \theta$$$ is the $$$X$$$-component in this new system, so $$$A \cdot B$$$ is the projection of $$$A$$$ over $$$B$$$, scaled by $$$|B|$$$. Therefore, the point with maximal projection over $$$B$$$ is the point with maximal dot product with $$$B$$$, since all projection are scaled by some constant amount -$$$|B|$$$. To find that point we can maintain the upper hull of the points increasingly sorted by $$$X$$$ and do binary search. To find the point with minimal projection over a fixed vector we can do the same but maintaining the Lower hull
But I've read in some article that there are a few ways to do it, so I want to know those ways.