> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/polygon-properties/st_centroid.md).

# ST\_CENTROID

## Syntax

```bnf
ST_Centroid(mpoly)
Centroid(mpoly)
```

## Description

Returns a point reflecting the mathematical centroid (geometric center) for the [MultiPolygon](/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/multipolygon.md) *mpoly*. The resulting point will not necessarily be on the MultiPolygon.

`ST_Centroid()` and `Centroid()` are synonyms.

## Examples

```sql
SET @poly = ST_GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))');
SELECT ST_AsText(ST_Centroid(@poly)) AS center;
+--------------+
| center       |
+--------------+
| POINT(10 10) |
+--------------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
