  ## How to calculate the area of a triangle ?

Calculating the area of a triangle is an elementary problem encountered often in many different situations. The best known and simplest formula is: $\mathrm{Area}=\frac{1}{2}bh$

where b is the length of the base of the triangle, and h is the height or altitude of the triangle. The term 'base' denotes any side, and 'height' denotes the length of a perpendicular from the vertex opposite the side onto the line containing the side itself.

Although simple, this formula is only useful if the height can be readily found. For example, the surveyor of a triangular field measures the length of each side, and can find the area from his results without having to construct a 'height'. Various methods may be used in practice, depending on what is known about the triangle. The following is a selection of frequently used formulae for the area of a triangle.

### Using vectors

The area of a parallelogram embedded in a three-dimensional Euclidean space can be calculated using vectors. Let vectors AB and AC point respectively from A to B and from A to C. The area of parallelogram ABDC is then $|{AB}\times{AC}|,$

which is the magnitude of the cross product of vectors AB and AC. The area of triangle ABC is half of this, $\frac{1}{2}|{AB}\times{AC}|.$.

The area of triangle ABC can also be expressed in terms of dot products as follows: $\frac{1}{2} \sqrt{(\mathbf{AB} \cdot \mathbf{AB})(\mathbf{AC} \cdot \mathbf{AC}) -(\mathbf{AB} \cdot \mathbf{AC})^2} =\frac{1}{2} \sqrt{ |\mathbf{AB}|^2 |\mathbf{AC}|^2 -(\mathbf{AB} \cdot \mathbf{AC})^2}.\,$

In two-dimensional Euclidean space, expressing vector AB as a free vector in Cartesian space equal to (x1,y1) and AC as (x2,y2), this can be rewritten as: $\frac{1}{2}\,|x_1 y_2 - x_2 y_1|.\,$

Applying trigonometry to find the altitude h.

### Using trigonometry

The height of a triangle can be found through the application of trigonometry.

Knowing SAS: Using the labels in the image on the left, the altitude is h = a sin γ. Substituting this in the formula Area = ½bh derived above, the area of the triangle can be expressed as: $\mathrm{Area} = \frac{1}{2}ab\sin \gamma = \frac{1}{2}bc\sin \alpha = \frac{1}{2}ca\sin \beta$

(where α is the interior angle at A, β is the interior angle at B, γ is the interior angle at C and c is the line AB).

Furthermore, since sin α = sin (π - α) = sin (β + γ), and similarly for the other two angles: $\mathrm{Area} = \frac{1}{2}ab\sin (\alpha+\beta) = \frac{1}{2}bc\sin (\beta+\gamma) = \frac{1}{2}ca\sin (\gamma+\alpha).$

Knowing AAS:

\mathrm{Area} = \frac {b^{2}(\sin \alpha)(\sin (\alpha + \beta))}{2\sin \beta},

and analogously if the known side is a or c.

Knowing ASA: $\mathrm{Area} = \frac {b^{2}(\sin \alpha)(\sin (\alpha + \beta))}{2\sin \beta},$

and analogously if the known side is b or c.

### Using coordinates

If vertex A is located at the origin (0, 0) of a Cartesian coordinate system and the coordinates of the other two vertices are given by B = (xB, yB) and C = (xC, yC), then the area can be computed as ½ times the absolute value of the determinant $\mathrm{Area} = \frac{1}{2}\left|\det\begin{pmatrix}x_B & x_C \\ y_B & y_C \end{pmatrix}\right| = \frac{1}{2}|x_B y_C - x_C y_B|.$

For three general vertices, the equation is: $\mathrm{Area} = \frac{1}{2} \left| \det\begin{pmatrix}x_A & x_B & x_C \\ y_A & y_B & y_C \\ 1 & 1 & 1\end{pmatrix} \right| = \frac{1}{2} \big| x_A y_B - x_A y_C + x_B y_C - x_B y_A + x_C y_A - x_C y_B \big|$ $\mathrm{Area} = \frac{1}{2} \big| (x_A - x_C) (y_B - y_A) - (x_A - x_B) (y_C - y_A) \big|.$

In three dimensions, the area of a general triangle {A = (xA, yA, zA), B = (xB, yB, zB) and C = (xC, yC, zC)} is the Pythagorean sum of the areas of the respective projections on the three principal planes (i.e. x = 0, y = 0 and z = 0): $\mathrm{Area} = \frac{1}{2} \sqrt{ \left( \det\begin{pmatrix} x_A & x_B & x_C \\ y_A & y_B & y_C \\ 1 & 1 & 1 \end{pmatrix} \right)^2 + \left( \det\begin{pmatrix} y_A & y_B & y_C \\ z_A & z_B & z_C \\ 1 & 1 & 1 \end{pmatrix} \right)^2 + \left( \det\begin{pmatrix} z_A & z_B & z_C \\ x_A & x_B & x_C \\ 1 & 1 & 1 \end{pmatrix} \right)^2 }.$

### Using line integrals

The area within any closed curve, such as a triangle, is given by the line integral around the curve of the algebraic or signed distance of a point on the curve from an arbitrary oriented straight line L. Points to the right of L as oriented are taken to be at negative distance from L, while the weight for the integral is taken to be the component of arc length parallel to L rather than arc length itself.

This method is well suited to computation of the area of an arbitrary polygon. Taking L to be the x-axis, the line integral between consecutive vertices (xi,yi) and (xi+1,yi+1) is given by the base times the mean height, namely (xi+1 − xi)(yi + yi+1)/2. The sign of the area is an overall indicator of the direction of traversal, with negative area indicating counterclockwise traversal. The area of a triangle then falls out as the case of a polygon with three sides.

While the line integral method has in common with other coordinate-based methods the arbitrary choice of a coordinate system, unlike the others it makes no arbitrary choice of vertex of the triangle as origin or of side as base. Furthermore the choice of coordinate system defined by L commits to only two degrees of freedom rather than the usual three, since the weight is a local distance (e.g. xi+1 − xi in the above) whence the method does not require choosing an axis normal to L.

When working in polar coordinates it is not necessary to convert to cartesian coordinates to use line integration, since the line integral between consecutive vertices (ri,θi) and (ri+1,θi+1) of a polygon is given directly by riri+1sin(θi+1 − θi)/2. This is valid for all values of θ, with some decrease in numerical accuracy when |θ| is many orders of magnitude greater than π. With this formulation negative area indicates clockwise traversal, which should be kept in mind when mixing polar and cartesian coordinates. Just as the choice of y-axis (x = 0) is immaterial for line integration in cartesian coordinates, so is the choice of zero heading (θ = 0) immaterial here.

### Using Heron's formula

The shape of the triangle is determined by the lengths of the sides alone. Therefore the area can also be derived from the lengths of the sides. By Heron's formula: $\mathrm{Area} = \sqrt{s(s-a)(s-b)(s-c)}$

where $s= \frac{a+b+c}{2}$ is the semiperimeter, or half of the triangle's perimeter.

Three equivalent ways of writing Heron's formula are $\mathrm{Area} = \frac{1}{4} \sqrt{(a^2+b^2+c^2)^2-2(a^4+b^4+c^4)}$ $\mathrm{Area} = \frac{1}{4} \sqrt{2(a^2b^2+a^2c^2+b^2c^2)-(a^4+b^4+c^4)}$ $\mathrm{Area} = \frac{1}{4} \sqrt{(a+b-c) (a-b+c) (-a+b+c) (a+b+c)}.$

### Formulas mimicking Heron's formula

Three formulas have the same structure as Heron's formula but are expressed in terms of different variables. First, denoting the medians from sides a, b, and c respectively as ma,mb, and mc and their semi-sum (ma + mb + mc) / 2 as σ, we have $\mathrm{Area} = \frac{4}{3} \sqrt{\sigma (\sigma - m_a)(\sigma - m_b)(\sigma - m_c)}.$

Next, denoting the altitudes from sides a, b, and c respectively as ha, hb, and hc,and denoting the semi-sum of the reciprocals of the altitudes as $H = (h_a^{-1} + h_b^{-1} + h_c^{-1})/2$ we have $\mathrm{Area}^{-1} = 4 \sqrt{H(H-h_a^{-1})(H-h_b^{-1})(H-h_c^{-1})}.$

And denoting the semi-sum of the angles' sines as $S=[(\sin \ \ \alpha)+(\sin \ \ \beta)+(\sin \ \ \gamma)]/2$ we have $\mathrm{Area} = D^{2} \sqrt{S(S-\sin \alpha)(S-\sin \beta)(S-\sin \gamma)}$

where D is the diameter of the circumcircle: $D=\tfrac{a}{\sin \alpha} = \tfrac{b}{\sin \beta} = \tfrac{c}{\sin \gamma}.$

### Using Pick's Theorem

See Pick's theorem for a technique for finding the area of any arbitrary lattice polygon.

The theorem states: $\mathrm{Area} = I + \frac{1}{2}B - 1$

where I is the number of internal lattice points and B is the number of lattice points lying inline with the border of the polygon.

### Other area formulas

Numerous other area formulas exist, such as $\mathrm{Area} = r \cdot s,$

where r is the inradius, and s is the semiperimeter; $\mathrm{Area} = \frac{1}{2}D^{2}(\sin \alpha)(\sin \beta)(\sin \gamma)$

for circumdiameter D; and $\mathrm{Area} = \frac{\tan \alpha}{4}(b^{2}+c^{2}-a^{2})$

for angle $\alpha \ne$ 90°.

In 1885, Baker gave a collection of over a hundred distinct area formulas for the triangle (although the reader should be advised that a few of them are incorrect). These include #9, #39a, #39b, #42, and #49: $\mathrm{Area} = \frac{1}{2}[abch_ah_bh_c]^{1/3},$ $\mathrm{Area} = \frac{1}{2} \sqrt{abh_ah_b},$ $\mathrm{Area} = \frac{a+b}{2(h_a^{-1} + h_b^{-1})},$ $\mathrm{Area} = \frac{Rh_bh_c}{a}$ $\mathrm{Area} = \frac{h_ah_b}{2 \sin \gamma}.$