Given 3 points in 3D, is there a way to calculate the area of the triangle made by them in O(1), considering the Cross Product will need to use the square root to calculate the magnitude of the vector produced by the cross product?
# | User | Rating |
---|---|---|
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 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Given 3 points in 3D, is there a way to calculate the area of the triangle made by them in O(1), considering the Cross Product will need to use the square root to calculate the magnitude of the vector produced by the cross product?
Name |
---|
There is no difference in the formula for 3D: abs(CrossProduct(P1 — P0, P2 — P0) / 2) should work again.
You need the square root function to compute the abs of the CrossProduct, isn't O(1).
I think it is impossible, because in any way you need to know the length of some vector or segment
Also if it was possible, how could we find the area of a triangle if it was of form .
There is a way to do that in 2D, which is applicable for all polygons by applying the following formula to all the polygon edges:
Which is O(1) for a triangle.
Imagine the points (0, 0, 0), (0, 0, 1) and (2, 1, 1). The area of the triangle, formed by them is . So if there was is a formula to exactly compute the area, then it should be able to somehow compute .