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 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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.