**Available since LÖVE 0.9.0**

This function is not supported in earlier versions.

Decomposes a simple convex or concave polygon into triangles.

triangles = love.math.triangulate( polygon )

`table polygon`

- Polygon to triangulate. Must not intersect itself.

`table triangles`

- List of triangles the polygon is composed of, in the form of
`{{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}`

.

triangles = love.math.triangulate( x1, y1, x2, y2, x3, y3, ... )

`number x1`

- The position of the first vertex of the polygon on the x-axis.
`number y1`

- The position of the first vertex of the polygon on the y-axis.
`number x2`

- The position of the second vertex of the polygon on the x-axis.
`number y2`

- The position of the second vertex of the polygon on the y-axis.
`number x3`

- The position of the third vertex of the polygon on the x-axis.
`number y3`

- The position of the third vertex of the polygon on the y-axis.

`table triangles`

- List of triangles the polygon is composed of, in the form of
`{{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}`

.

© 2006–2016 LÖVE Development Team

Licensed under the GNU Free Documentation License, Version 1.3.

https://love2d.org/wiki/love.math.triangulate