# Triangle

A triangle is a polygon with three corners and three sides, one of the basic shapes in geometry. The corners, also called vertices, are zero-dimensional points while the sides connecting them, also called edges, are one-dimensional line segments. A triangle has three internal angles, each one bounded by a pair of adjacent edges; the sum of angles of a triangle always equals a straight angle (180 degrees or π radians). The triangle is a plane figure and its interior is a planar region. Sometimes an arbitrary edge is chosen to be the base, in which case the opposite vertex is called the apex; the shortest segment between the base and apex is the height. The area of a triangle equals one-half the product of height and base length.
In Euclidean geometry, any two points determine a unique line segment situated within a unique straight line, and any three points that do not all lie on the same straight line determine a unique triangle situated within a unique flat plane. More generally, four points in three-dimensional Euclidean space determine a solid figure called tetrahedron.
In non-Euclidean geometries, three "straight" segments (having zero curvature) also determine a "triangle", for instance, a spherical triangle or hyperbolic triangle. A geodesic triangle is a region of a general two-dimensional surface enclosed by three sides that are straight relative to the surface (geodesics). A curvilinear triangle is a shape with three curved sides, for instance, a circular triangle with circular-arc sides. (This article is about straight-sided triangles in Euclidean geometry, except where otherwise noted.)
Triangles are classified into different types based on their angles and the lengths of their sides. Relations between angles and side lengths are a major focus of trigonometry. In particular, the sine, cosine, and tangent functions relate side lengths and angles in right triangles.

## Definition, terminology, and types

A triangle is a figure consisting of three line segments, each of whose endpoints are connected. This forms a polygon with three sides and three angles. The terminology for categorizing triangles is more than two thousand years old, having been defined in Book One of Euclid's Elements. The names used for modern classification are either a direct transliteration of Euclid's Greek or their Latin translations.
Triangles have many types based on the length of the sides and the angles. A triangle whose sides are all the same length is an equilateral triangle, a triangle with two sides having the same length is an isosceles triangle, and a triangle with three different-length sides is a scalene triangle. A triangle in which one of the angles is a right angle is a right triangle, a triangle in which all of its angles are less than that angle is an acute triangle, and a triangle in which one of it angles is greater than that angle is an obtuse triangle. These definitions date back at least to Euclid.
* Equilateral triangle
* Isosceles triangle
* Scalene triangle
* Right triangle
* Acute triangle
* Obtuse triangle

## Appearances

All types of triangles are commonly found in real life. In man-made construction, the isosceles triangles may be found in the shape of gables and pediments, and the equilateral triangle can be found in the yield sign. The faces of the Great Pyramid of Giza are sometimes considered to be equilateral, but more accurate measurements show they are isosceles instead. Other appearances are in heraldic symbols as in the flag of Saint Lucia and flag of the Philippines.
Triangles also appear in three-dimensional objects. A polyhedron is a solid whose boundary is covered by flat polygonals known as the faces, sharp corners known as the vertices, and line segments known as the edges. Polyhedra in some cases can be classified, judging from the shape of their faces. For example, when polyhedra have all equilateral triangles as their faces, they are known as deltahedra. Antiprisms have alternating triangles on their sides. Pyramids and bipyramids are polyhedra with polygonal bases and triangles for lateral faces; the triangles are isosceles whenever they are right pyramids and bipyramids. The Kleetope of a polyhedron is a new polyhedron made by replacing each face of the original with a pyramid, and so the faces of a Kleetope will be triangles. More generally, triangles can be found in higher dimensions, as in the generalized notion of triangles known as the simplex, and the polytopes with triangular facets known as the simplicial polytopes.

## Properties
### Points, lines, and circles associated with a triangle

Each triangle has many special points inside it, on its edges, or otherwise associated with it. They are constructed by finding three lines associated symmetrically with the three sides (or vertices) and then proving that the three lines meet in a single point. An important tool for proving the existence of these points is Ceva's theorem, which gives a criterion for determining when three such lines are concurrent. Similarly, lines associated with a triangle are often constructed by proving that three symmetrically constructed points are collinear; here Menelaus' theorem gives a useful general criterion. In this section, just a few of the most commonly encountered constructions are explained.
A perpendicular bisector of a side of a triangle is a straight line passing through the midpoint of the side and being perpendicular to it, forming a right angle with it. The three perpendicular bisectors meet in a single point, the triangle's circumcenter; this point is the center of the circumcircle, the circle passing through all three vertices. Thales' theorem implies that if the circumcenter is located on the side of the triangle, then the angle opposite that side is a right angle. If the circumcenter is located inside the triangle, then the triangle is acute; if the circumcenter is located outside the triangle, then the triangle is obtuse.
An altitude of a triangle is a straight line through a vertex and perpendicular to the opposite side. This opposite side is called the base of the altitude, and the point where the altitude intersects the base (or its extension) is called the foot of the altitude. The length of the altitude is the distance between the base and the vertex. The three altitudes intersect in a single point, called the orthocenter of the triangle. The orthocenter lies inside the triangle if and only if the triangle is acute.
An angle bisector of a triangle is a straight line through a vertex that cuts the corresponding angle in half. The three angle bisectors intersect in a single point, the incenter, which is the center of the triangle's incircle. The incircle is the circle that lies inside the triangle and touches all three sides. Its radius is called the inradius. There are three other important circles, the excircles; they lie outside the triangle and touch one side, as well as the extensions of the other two. The centers of the incircles and excircles form an orthocentric system. The midpoints of the three sides and the feet of the three altitudes all lie on a single circle, the triangle's nine-point circle. The remaining three points for which it is named are the midpoints of the portion of altitude between the vertices and the orthocenter. The radius of the nine-point circle is half that of the circumcircle. It touches the incircle (at the Feuerbach point) and the three excircles. The orthocenter (blue point), the center of the nine-point circle (red), the centroid (orange), and the circumcenter (green) all lie on a single line, known as Euler's line (red line). The center of the nine-point circle lies at the midpoint between the orthocenter and the circumcenter, and the distance between the centroid and the circumcenter is half that between the centroid and the orthocenter. Generally, the incircle's center is not located on Euler's line.
A median of a triangle is a straight line through a vertex and the midpoint of the opposite side, and divides the triangle into two equal areas. The three medians intersect in a single point, the triangle's centroid or geometric barycenter. The centroid of a rigid triangular object (cut out of a thin sheet of uniform density) is also its center of mass: the object can be balanced on its centroid in a uniform gravitational field. The centroid cuts every median in the ratio 2:1, i.e. the distance between a vertex and the centroid is twice the distance between the centroid and the midpoint of the opposite side. If one reflects a median in the angle bisector that passes through the same vertex, one obtains a symmedian. The three symmedians intersect in a single point, the symmedian point of the triangle.

### Angles

The sum of the measures of the interior angles of a triangle in Euclidean space is always 180 degrees. This fact is equivalent to Euclid's parallel postulate. This allows the determination of the measure of the third angle of any triangle, given the measure of two angles. An exterior angle of a triangle is an angle that is a linear pair (and hence supplementary) to an interior angle. The measure of an exterior angle of a triangle is equal to the sum of the measures of the two interior angles that are not adjacent to it; this is the exterior angle theorem. The sum of the measures of the three exterior angles (one for each vertex) of any triangle is 360 degrees, and indeed, this is true for any convex polygon, no matter how many sides it has.
Another relation between the internal angles and triangles creates a new concept of trigonometric functions. The primary trigonometric functions are sine and cosine, as well as the other functions. They can be defined as the ratio between any two sides of a right triangle. In a scalene triangle, the trigonometric functions can be used to find the unknown measure of either a side or an internal angle; methods for doing so use the law of sines and the law of cosines.
Any three angles that add to 180° can be the internal angles of a triangle. Infinitely many triangles have the same angles, since specifying the angles of a triangle does not determine its size. (A degenerate triangle, whose vertices are collinear, has internal angles of 0° and 180°; whether such a shape counts as a triangle is a matter of convention.) The conditions for three angles $\alpha$, $\beta$, and $\gamma$, each of them between 0° and 180°, to be the angles of a triangle can also be stated using trigonometric functions. For example, a triangle with angles $\alpha$, $\beta$, and $\gamma$ exists if and only if $\cos ^{2}\alpha +\cos ^{2}\beta +\cos ^{2}\gamma +2\cos(\alpha )\cos(\beta )\cos(\gamma )=1.$

### Similarity and congruence

Two triangles are said to be similar, if every angle of one triangle has the same measure as the corresponding angle in the other triangle. The corresponding sides of similar triangles have lengths that are in the same proportion, and this property is also sufficient to establish similarity.
Some basic theorems about similar triangles are:
* If and only if one pair of internal angles of two triangles have the same measure as each other, and another pair also have the same measure as each other, the triangles are similar.
* If and only if one pair of corresponding sides of two triangles are in the same proportion as another pair of corresponding sides, and their included angles have the same measure, then the triangles are similar. (The included angle for any two sides of a polygon is the internal angle between those two sides.)
* If and only if three pairs of corresponding sides of two triangles are all in the same proportion, then the triangles are similar.
Two triangles that are congruent have exactly the same size and shape. All pairs of congruent triangles are also similar, but not all pairs of similar triangles are congruent. Given two congruent triangles, all pairs of corresponding interior angles are equal in measure, and all pairs of corresponding sides have the same length. This is a total of six equalities, but three are often sufficient to prove congruence.
Some individually necessary and sufficient conditions for a pair of triangles to be congruent are:
* SAS Postulate: Two sides in a triangle have the same length as two sides in the other triangle, and the included angles have the same measure.
* ASA: Two interior angles and the side between them in a triangle have the same measure and length, respectively, as those in the other triangle. (This is the basis of surveying by triangulation.)
* SSS: Each side of a triangle has the same length as the corresponding side of the other triangle.
* AAS: Two angles and a corresponding (non-included) side in a triangle have the same measure and length, respectively, as those in the other triangle. (This is sometimes referred to as AAcorrS and then includes ASA above.)

### Area

In the Euclidean plane, area is defined by comparison with a square of side length ⁠$1$⁠, which has area 1. There are several ways to calculate the area of an arbitrary triangle. One of the oldest and simplest is to take half the product of the length of one side ⁠$b$⁠ (the base) times the corresponding altitude ⁠$h$⁠: $T={\tfrac {1}{2}}bh.$
This formula can be proven by cutting up the triangle and an identical copy into pieces and rearranging the pieces into the shape of a rectangle of base ⁠$b$⁠ and height ⁠$h$⁠.
If two sides ⁠$a$⁠ and ⁠$b$⁠ and their included angle $\gamma$ are known, then the altitude can be calculated using trigonometry, ⁠$h=a\sin(\gamma )$⁠, so the area of the triangle is: $T={\tfrac {1}{2}}ab\sin \gamma .$
Heron's formula, named after Heron of Alexandria, is a formula for finding the area of a triangle from the lengths of its sides $a$, $b$, $c$. Letting $s={\tfrac {1}{2}}(a+b+c)$ be the semiperimeter, $T={\sqrt {s(s-a)(s-b)(s-c)}}.$
Because the ratios between areas of shapes in the same plane are preserved by affine transformations, the relative areas of triangles in any affine plane can be defined without reference to a notion of distance or squares. In any affine space (including Euclidean planes), every triangle with the same base and oriented area has its apex (the third vertex) on a line parallel to the base, and their common area is half of that of a parallelogram with the same base whose opposite side lies on the parallel line. This affine approach was developed in Book 1 of Euclid's Elements.
Given affine coordinates (such as Cartesian coordinates) ⁠$(x_{A},y_{A})$⁠, ⁠$(x_{B},y_{B})$⁠, ⁠$(x_{C},y_{C})$⁠ for the vertices of a triangle, its relative oriented area can be calculated using the shoelace formula,
${\begin{aligned}T&={\tfrac {1}{2}}{\begin{vmatrix}x_{A}&x_{B}&x_{C}\\y_{A}&y_{B}&y_{C}\\1&1&1\end{vmatrix}}={\tfrac {1}{2}}{\begin{vmatrix}x_{A}&x_{B}\\y_{A}&y_{B}\end{vmatrix}}+{\tfrac {1}{2}}{\begin{vmatrix}x_{B}&x_{C}\\y_{B}&y_{C}\end{vmatrix}}+{\tfrac {1}{2}}{\begin{vmatrix}x_{C}&x_{A}\\y_{C}&y_{A}\end{vmatrix}}\\&={\tfrac {1}{2}}(x_{A}y_{B}-x_{B}y_{A}+x_{B}y_{C}-x_{C}y_{B}+x_{C}y_{A}-x_{A}y_{C}),\end{aligned}}$
where $|\cdot |$ is the matrix determinant.

### Possible side lengths

The triangle inequality states that the sum of the lengths of any two sides of a triangle must be greater than or equal to the length of the third side. Conversely, some triangle with three given positive side lengths exists if and only if those side lengths satisfy the triangle inequality. The sum of two side lengths can equal the length of the third side only in the case of a degenerate triangle, one with collinear vertices.

### Rigidity

Unlike a rectangle, which may collapse into a parallelogram from pressure to one of its points, triangles are sturdy because specifying the lengths of all three sides determines the angles. Therefore, a triangle will not change shape unless its sides are bent or extended or broken or if its joints break; in essence, each of the three sides supports the other two. A rectangle, in contrast, is more dependent on the strength of its joints in a structural sense.
Triangles are strong in terms of rigidity, but while packed in a tessellating arrangement triangles are not as strong as hexagons under compression (hence the prevalence of hexagonal forms in nature). Tessellated triangles still maintain superior strength for cantilevering, however, which is why engineering makes use of tetrahedral trusses.

### Triangulation

Triangulation means the partition of any planar object into a collection of triangles. For example, in polygon triangulation, a polygon is subdivided into multiple triangles that are attached edge-to-edge, with the property that their vertices coincide with the set of vertices of the polygon. In the case of a simple polygon with $n$ sides, there are $n-2$ triangles that are separated by $n-3$ diagonals. Triangulation of a simple polygon has a relationship to the ear, a vertex connected by two other vertices, the diagonal between which lies entirely within the polygon. The two ears theorem states that every simple polygon that is not itself a triangle has at least two ears.

## Location of a point

One way to identify locations of points in (or outside) a triangle is to place the triangle in an arbitrary location and orientation in the Cartesian plane, and to use Cartesian coordinates. While convenient for many purposes, this approach has the disadvantage of all points' coordinate values being dependent on the arbitrary placement in the plane.
Two systems avoid that feature, so that the coordinates of a point are not affected by moving the triangle, rotating it, or reflecting it as in a mirror, any of which gives a congruent triangle, or even by rescaling it to a similar triangle:
* Trilinear coordinates specify the relative distances of a point from the sides, so that coordinates $x:y:z$ indicate that the ratio of the distance of the point from the first side to its distance from the second side is $x:y$, etc.
* Barycentric coordinates of the form $\alpha :\beta :\gamma$ specify the point's location by the relative weights that would have to be put on the three vertices in order to balance the otherwise weightless triangle on the given point.

## Related figures
### Figures inscribed in a triangle

As discussed above, every triangle has a unique inscribed circle (incircle) that is interior to the triangle and tangent to all three sides. Every triangle has a unique Steiner inellipse which is interior to the triangle and tangent at the midpoints of the sides. Marden's theorem shows how to find the foci of this ellipse. This ellipse has the greatest area of any ellipse tangent to all three sides of the triangle. The Mandart inellipse of a triangle is the ellipse inscribed within the triangle tangent to its sides at the contact points of its excircles. For any ellipse inscribed in a triangle $ABC$, let the foci be $P$ and $Q$, then: ${\frac {{\overline {PA}}\cdot {\overline {QA}}}{{\overline {CA}}\cdot {\overline {AB}}}}+{\frac {{\overline {PB}}\cdot {\overline {QB}}}{{\overline {AB}}\cdot {\overline {BC}}}}+{\frac {{\overline {PC}}\cdot {\overline {QC}}}{{\overline {BC}}\cdot {\overline {CA}}}}=1.$
From an interior point in a reference triangle, the nearest points on the three sides serve as the vertices of the pedal triangle of that point. If the interior point is the circumcenter of the reference triangle, the vertices of the pedal triangle are the midpoints of the reference triangle's sides, and so the pedal triangle is called the midpoint triangle or medial triangle. The midpoint triangle subdivides the reference triangle into four congruent triangles which are similar to the reference triangle.
The intouch triangle of a reference triangle has its vertices at the three points of tangency of the reference triangle's sides with its incircle. The extouch triangle of a reference triangle has its vertices at the points of tangency of the reference triangle's excircles with its sides (not extended).
The inscribed squares tangent their vertices to the triangle's sides is the special case of inscribed square problem, although the problem asking for a square whose vertices lie on a simple closed curve. A notable example of this figure relation is the Calabi triangle in which the vertices of every three squares are tangent to all obtuse triangle's sides. Every acute triangle has three inscribed squares (squares in its interior such that all four of a square's vertices lie on a side of the triangle, so two of them lie on the same side and hence one side of the square coincides with part of a side of the triangle). In a right triangle, two of the squares coincide and have a vertex at the triangle's right angle, so a right triangle has only two distinct inscribed squares. An obtuse triangle has only one inscribed square, with a side coinciding with part of the triangle's longest side. Within a given triangle, a longer common side is associated with a smaller inscribed square. If an inscribed square has a side of length $q_{a}$ and the triangle has a side of length $a$, part of which side coincides with a side of the square, then $q_{a}$, $a$, $h_{a}$ from the side $a$, and the triangle's area $T$ are related according to$q_{a}={\frac {2Ta}{a^{2}+2T}}={\frac {ah_{a}}{a+h_{a}}}.$The largest possible ratio of the area of the inscribed square to the area of the triangle is 1/2, which occurs when $a^{2}=2T$, $q=a/2$, and the altitude of the triangle from the base of length $a$ is equal to $a$. The smallest possible ratio of the side of one inscribed square to the side of another in the same non-obtuse triangle is $2{\sqrt {2}}/3$. Both of these extreme cases occur for the isosceles right triangle.
The Lemoine hexagon is a cyclic hexagon with vertices given by the six intersections of the sides of a triangle with the three lines that are parallel to the sides and that pass through its symmedian point. In either its simple form or its self-intersecting form, the Lemoine hexagon is interior to the triangle with two vertices on each side of the triangle.
Every convex polygon with area $T$ can be inscribed in a triangle of area at most equal to $2T$. Equality holds only if the polygon is a parallelogram.

### Figures circumscribed about a triangle

The tangential triangle of a reference triangle (other than a right triangle) is the triangle whose sides are on the tangent lines to the reference triangle's circumcircle at its vertices.
As mentioned above, every triangle has a unique circumcircle, a circle passing through all three vertices, whose center is the intersection of the perpendicular bisectors of the triangle's sides. Furthermore, every triangle has a unique Steiner circumellipse, which passes through the triangle's vertices and has its center at the triangle's centroid. Of all ellipses going through the triangle's vertices, it has the smallest area.
The Kiepert hyperbola is unique conic that passes through the triangle's three vertices, its centroid, and its circumcenter.
Of all triangles contained in a given convex polygon, one with maximal area can be found in linear time; its vertices may be chosen as three of the vertices of the given polygon.

## Miscellaneous triangles
### Circular triangles

A circular triangle is a triangle with circular arc edges. The edges of a circular triangle may be either convex (bending outward) or concave (bending inward). The intersection of three disks forms a circular triangle whose sides are all convex. An example of a circular triangle with three convex edges is a Reuleaux triangle, which can be made by intersecting three circles of equal size. The construction may be performed with a compass alone without needing a straightedge, by the Mohr–Mascheroni theorem. Alternatively, it can be constructed by rounding the sides of an equilateral triangle.
A special case of concave circular triangle can be seen in a pseudotriangle. A pseudotriangle is a simply-connected subset of the plane lying between three mutually tangent convex regions. These sides are three smoothed curved lines connecting their endpoints called the cusp points. Any pseudotriangle can be partitioned into many pseudotriangles with the boundaries of convex disks and bitangent lines, a process known as pseudo-triangulation. For $n$ disks in a pseudotriangle, the partition gives $2n-2$ pseudotriangles and $3n-3$ bitangent lines. The convex hull of any pseudotriangle is a triangle.

### Triangle in non-planar space

A non-planar triangle is a triangle not included in Euclidean space, roughly speaking a flat space. This means triangles may also be discovered in several spaces, as in hyperbolic space and spherical geometry. A triangle in hyperbolic space is called a hyperbolic triangle, and it can be obtained by drawing on a negatively curved surface, such as a saddle surface. Likewise, a triangle in spherical geometry is called a spherical triangle, and it can be obtained by drawing on a positively curved surface such as a sphere.
The triangles in both spaces have properties different from the triangles in Euclidean space. For example, as mentioned above, the internal angles of a triangle in Euclidean space always add up to 180°. However, the sum of the internal angles of a hyperbolic triangle is less than 180°, and for any spherical triangle, the sum is more than 180°. In particular, it is possible to draw a triangle on a sphere such that the measure of each of its internal angles equals 90°, adding up to a total of 270°. By Girard's theorem, the sum of the angles of a triangle on a sphere is $180^{\circ }\times (1+4f)$, where $f$ is the fraction of the sphere's area enclosed by the triangle.
In more general spaces, there are comparison theorems relating the properties of a triangle in the space to properties of a corresponding triangle in a model space like hyperbolic or elliptic space. For example, a CAT(k) space is characterized by such comparisons.

### Fractal geometry

Fractal shapes based on triangles include the Sierpiński gasket and the Koch snowflake.