0
\$\begingroup\$

I have a feature which allows marking point on a surface and usnig raycast and mouse click position. You can click as many points as you want, then the last point connects with the first point to complete the shape. All the things are working fine. enter image description here But now I am looking for a way to calculate the area. I make a little study and found that there are different formulas for different shapes. Like for

  1. Area of Rectangle Area = l × w where l = length w = width
  2. Area of Square Area = a2 where a = sides of the square
  3. Area of a Triangle Area = 1/2 b×h where b = baseh = height and so on

My question is how should I calculate the area. The user has flexibility to create any kind of shape but how should i know which user has created and use the exact formula to show the area? Or is there any general way to show the area?

\$\endgroup\$
1

0

You must log in to answer this question.

Browse other questions tagged .