CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   area of triangle (

clifford bradford June 1, 2001 14:27

area of triangle
How do I find the area of a triangle in 2-D if I know the coordinates of the corners?

bronze June 1, 2001 14:36

Re: area of triangle
use Heron's law:

a^2 = s(s-a)(s-b)(s-c)

a=area a,b,c = side lengths s=0.5*(a+b+c)

(works well for 3-d too)

bronze June 1, 2001 14:38

Re: area of triangle

The method and the code :)

Sid June 1, 2001 17:05

Re: area of triangle
The three vertices are ordered in counterclockwise order, (x1,y1), (x2,y2), (x3,y3). Then,


which can be derived easily by computing a cross product of a parir (any pair) of the side vectors.


clifford bradford June 1, 2001 18:38

Re: area of triangle
Aha! Thanks.

Barry June 2, 2001 09:33

Re: area of triangle

The very best way to do it is to calculate the cross product using two vectors (sharing the same origen)(one of the corner vertex of the triangle) which forms the edges of the triangle. Half the norm of the resulting vector will give ya the surface area AND by doing so you already calculated a normal to the surface which ye want anyhow. Just make sure your convention is correct, otherwise your normal vector might point in the wrong direction.

Cheers Barry

All times are GMT -4. The time now is 04:55.