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.
# | User | Rating |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 166 |
3 | Um_nik | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
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.
Name |
---|
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.