{{newin|[[0.9.0]]|090|type=function}}
Decomposes a simple convex or concave polygon into triangles.
== Function ==
=== Synopsis ===
<source lang="lua">
triangles = love.math.triangulate( polygon )
</source>
=== Arguments ===
{{param|table|polygon|Polygon to triangulate. Must not intersect itself.}}
=== Returns ===
{{param|table|triangles|List of triangles the polygon is composed of, in the form of <code><nowiki>{{x1, y1, x2, y2, x3, y3},  {x1, y1, x2, y2, x3, y3}, ...}</nowiki></code>.}}
== Function ==
=== Synopsis ===
<source lang="lua">
triangles = love.math.triangulate( x1, y1, x2, y2, x3, y3, ... )
</source>
=== Arguments ===
{{param|number|x1|The position of the first vertex of the polygon on the x-axis.}}
{{param|number|y1|The position of the first vertex of the polygon on the y-axis.}}
{{param|number|x2|The position of the second vertex of the polygon on the x-axis.}}
{{param|number|y2|The position of the second vertex of the polygon on the y-axis.}}
{{param|number|x3|The position of the third vertex of the polygon on the x-axis.}}
{{param|number|y3|The position of the third vertex of the polygon on the y-axis.}}
=== Returns ===
{{param|table|triangles|List of triangles the polygon is composed of, in the form of <code><nowiki>{{x1, y1, x2, y2, x3, y3},  {x1, y1, x2, y2, x3, y3}, ...}</nowiki></code>.}}
== See Also ==
* [[parent::love.math]]
* [[love.graphics.polygon]]
* [[love.physics.newPolygonShape]]
[[Category:Functions]]
{{#set:Description=Decomposes a simple polygon into triangles.}}
== Other Languages ==
{{i18n|love.math.triangulate}}