# Triangle

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 • 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:
•  VertexColors Automatic vertex colors to be interpolated VertexNormals Automatic effective vertex normals for shading VertexTextureCoordinates None coordinates for textures
• Triangle can be used with symbolic points in GeometricScene.

# Examples

open allclose all

## Basic 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)

Color directives specify the face color:

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

#### Coordinates(3)

Use Scaled coordinates:

Use ImageScaled coordinates:

Use Offset coordinates:

### 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: