Triangle
Details and Options
- Triangle can be used as a geometric region and a graphics primitive.
- Triangle represents a planar region consisting of all convex combinations of corner points pi, .
- Triangle [] is equivalent to Triangle [{{0,0},{1,0},{0,1}}].
- CanonicalizePolygon can be used to convert a triangle to an explicit Polygon object.
- As a geometric region, the points pi can have any length.
- Triangle can be used in Graphics and Graphics3D .
- In graphics, the points pi can be Scaled , Offset , ImageScaled , and Dynamic expressions.
- Graphics rendering is affected by directives such as FaceForm , EdgeForm , Texture , and color.
- The following options and settings can be used in graphics:
-
- Triangle can be used with symbolic points in GeometricScene .
Background & Context
- Triangle [{p1,p2,p3}] represents the filled triangle with vertices p1, p2 and p3, where each pi is specified as a list with length corresponding to the embedding dimension. Most commonly, the vertices of a Triangle are lists of length two (giving a triangle in the 2D plane) or three (giving a triangle embedded in 3D space). The zero-argument form Triangle [] evaluates to the standard 2-simplex Triangle [{{0,0},{1,0},{0,1}}]. The syntax Triangle [{{p11,p12,p13},…,{pk1,pk2,pk3}}] may be used to represent a multi-triangle collection.
- Triangle objects can be visually formatted in two and three dimensions using Graphics and Graphics3D , respectively. As with other graphics primitives, the appearance of Triangle objects in graphics can be modified by specifying edge and face directives EdgeForm and FaceForm , color directives such as Red , the transparency directive Opacity and the style option Antialiasing . Texture may be used to apply objects as textures on the faces of Triangle objects, and the options VertexColors , VertexNormals and VertexTextureCoordinates may be used to apply additional formatting.
- Triangle may also serve as a region specification over which a computation should be performed. RegionMeasure (and Area ) returns the area of a Triangle object, while RegionDimension and RegionEmbeddingDimension return 2 and Length [pi], respectively, for Triangle [{p1,p2,p3}]. In addition, GeometricTransformation and more specific transformation functions such as Translate and Rotate can be used to represent the result of applying relevant geometric transformations to a Triangle .
- Triangle is related to a number of other symbols. AASTriangle , SSSTriangle , ASATriangle and SASTriangle return two-dimensional Triangle objects constructed using relevant side and angle specifications. Triangle is a special case of both Polygon and Simplex , in the sense that Triangle [{p1,p2,p3}] is equivalent to both Polygon [{p1,p2,p3}] and Simplex [{p1,p2,p3}]. The three-dimensional simplex generalization of Triangle is implemented as Tetrahedron .
Examples
open all close allBasic Examples (4)
A standard triangle in 2D:
A triangle in 3D:
Different styles applied to Triangle :
Area and centroid:
Scope (18)
Graphics (8)
Specification (3)
A standard triangle in 2D:
A triangle in 3D:
Multiple triangles:
Styling (2)
Coordinates (3)
Regions (10)
Embedding dimension is the length of the coordinates:
Geometric dimension refers to the region it specifies:
Membership testing:
Conditions for point membership:
Area :
Centroid:
Distance from a point to a Triangle :
Plot it:
Signed distance from a point to the triangle:
Plot it:
Nearest point:
Visualize it:
A triangle is bounded:
The bounding range:
Integrate over a triangle:
Optimize over a triangle:
Plot the function over the region:
Solve equations with triangle constraints:
Applications (6)
The standard simplex and Kuhn simplex in 2D are triangles:
Define an equilateral triangle by side length:
Visualize it:
Compute its Area :
Equivalently use SSSTriangle :
Define an isosceles triangle by base length and height:
Visualize it:
Compute its Area :
Find a perpendicular bisector of a triangle:
Visualize circumcenter and bisectors in red:
One way of measuring the quality of a triangle is the radius/edge ratio:
A lower ratio indicates that the triangle will not be unusually thin:
A triangle can be subdivided into four sub-triangles:
This can be done recursively:
Properties & Relations (5)
Triangle is a special case of Polygon :
Triangle is a special case of Simplex :
ImplicitRegion can represent any Triangle region:
ParametricRegion can represent any Triangle region:
BoundaryMeshRegion can represent any Triangle region:
Neat Examples (1)
A collection of random triangles:
See Also
Polygon AASTriangle SSSTriangle ASATriangle SASTriangle Tetrahedron Simplex GeometricScene
Formats: STL
Function Repository: Orthocenter HeronFormula LucasCircles NagelPoint EulerLinePoints LemoineInellipse
Related Guides
Text
Wolfram Research (2014), Triangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Triangle.html (updated 2019).
CMS
Wolfram Language. 2014. "Triangle." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Triangle.html.
APA
Wolfram Language. (2014). Triangle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Triangle.html
BibTeX
@misc{reference.wolfram_2025_triangle, author="Wolfram Research", title="{Triangle}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Triangle.html}", note=[Accessed: 06-January-2026]}
BibLaTeX
@online{reference.wolfram_2025_triangle, organization={Wolfram Research}, title={Triangle}, year={2019}, url={https://reference.wolfram.com/language/ref/Triangle.html}, note=[Accessed: 06-January-2026]}