Vendetta.'s blog

By Vendetta., 6 years ago, In English

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?

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

There is no difference in the formula for 3D: abs(CrossProduct(P1 — P0, P2 — P0) / 2) should work again.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You need the square root function to compute the abs of the CrossProduct, isn't O(1).

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      I think it is impossible, because in any way you need to know the length of some vector or segment

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Also if it was possible, how could we find the area of a triangle if it was of form .

      • »
        »
        »
        »
        6 years ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
            Vote: I like it +4 Vote: I do not like it

          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 .