WOLFRAM

Triangle[{p1,p2,p3}]

represents a filled triangle with corner points p1, p2, and p3.

Triangle[{{p11,p12,p13},}]

represents a collection of triangles.

Details and Options

Background & Context

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

A standard triangle in 2D:

Out[1]=1

A triangle in 3D:

Out[1]=1

Different styles applied to Triangle:

Out[1]=1

Area and centroid:

Out[1]=1
Out[2]=2

Scope  (18)Survey of the scope of standard use cases

Graphics  (8)

Specification  (3)

A standard triangle in 2D:

Out[1]=1

A triangle in 3D:

Out[1]=1

Multiple triangles:

Out[2]=2

Styling  (2)

Color directives specify the face color:

Out[1]=1

FaceForm and EdgeForm can be used to specify the styles of the interior and boundary:

Out[1]=1

Coordinates  (3)

Use Scaled coordinates:

Out[1]=1

Use ImageScaled coordinates:

Out[1]=1

Use Offset coordinates:

Out[1]=1

Regions  (10)

Embedding dimension is the length of the coordinates:

Out[1]=1
Out[2]=2

Geometric dimension refers to the region it specifies:

Out[3]=3
Out[4]=4

Membership testing:

Out[2]=2

Conditions for point membership:

Out[3]=3

Area:

Out[2]=2

Centroid:

Out[3]=3
Out[4]=4

Distance from a point to a Triangle:

Out[2]=2

Plot it:

Out[3]=3

Signed distance from a point to the triangle:

Out[2]=2

Plot it:

Out[3]=3

Nearest point:

Out[2]=2

Visualize it:

Out[4]=4

A triangle is bounded:

Out[2]=2

The bounding range:

Out[3]=3
Out[4]=4

Integrate over a triangle:

Out[2]=2
Out[3]=3

Optimize over a triangle:

Out[2]=2

Plot the function over the region:

Out[3]=3

Solve equations with triangle constraints:

Out[2]=2

Applications  (6)Sample problems that can be solved with this function

The standard simplex and Kuhn simplex in 2D are triangles:

Out[1]=1

Define an equilateral triangle by side length:

Out[2]=2

Visualize it:

Out[3]=3

Compute its Area:

Out[4]=4

Equivalently use SSSTriangle:

Out[5]=5

Define an isosceles triangle by base length and height:

Out[2]=2

Visualize it:

Out[3]=3

Compute its Area:

Out[4]=4

Find a perpendicular bisector of a triangle:

Visualize circumcenter and bisectors in red:

Out[4]=4

One way of measuring the quality of a triangle is the radius/edge ratio:

Out[2]=2

A lower ratio indicates that the triangle will not be unusually thin:

Out[3]=3

A triangle can be subdivided into four sub-triangles:

Out[2]=2

This can be done recursively:

Out[4]=4

Properties & Relations  (5)Properties of the function, and connections to other functions

Triangle is a special case of Polygon:

Out[4]=4

Triangle is a special case of Simplex:

Out[2]=2

ImplicitRegion can represent any Triangle region:

Out[2]=2

ParametricRegion can represent any Triangle region:

Out[2]=2

BoundaryMeshRegion can represent any Triangle region:

Out[1]=1

Neat Examples  (1)Surprising or curious use cases

A collection of random triangles:

Out[1]=1
Wolfram Research (2014), Triangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Triangle.html (updated 2019).
Wolfram Research (2014), Triangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Triangle.html (updated 2019).

Text

Wolfram Research (2014), Triangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Triangle.html (updated 2019).

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.

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

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: 23-February-2025 ]}

@misc{reference.wolfram_2025_triangle, author="Wolfram Research", title="{Triangle}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Triangle.html}", note=[Accessed: 23-February-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_triangle, organization={Wolfram Research}, title={Triangle}, year={2019}, url={https://reference.wolfram.com/language/ref/Triangle.html}, note=[Accessed: 23-February-2025 ]}

@online{reference.wolfram_2025_triangle, organization={Wolfram Research}, title={Triangle}, year={2019}, url={https://reference.wolfram.com/language/ref/Triangle.html}, note=[Accessed: 23-February-2025 ]}