Vector of trianglesSource:
Triangles are sets of three vertices in either 2 or three dimensions. In three dimensions the order of the vertices determines the orientation of the triangle with vertices being in counter-clockwise order from the facing side. If the 3 vertices are colinear the triangle is considered to be degenerate
Various input. See the Constructor section.
The dimensionality when constructing an empty vector
A vector of triangles or an object to convert to it
2 and 3 dimensional triangles
Providing three points will construct triangles in the order the points are given.
# Construction p <- point(sample(6), sample(6)) t <- triangle(p[1:2], p[3:4], p[5:6]) t #> <2D triangles > #>  [<x:5, y:6>, <x:2, y:4>, <x:3, y:5>] [<x:1, y:1>, <x:6, y:2>, <x:4, y:3>] plot(t) # 3D triangles can be converted to planes p <- point(sample(6), sample(6), sample(6)) t <- triangle(p[1:2], p[3:4], p[5:6]) as_plane(t) #> <3D euclid_planes > #>  <a:5, b:3, c:4, d:-40> <a:1, b:0, c:1, d:-7>