With this centroid calculator, we're giving you a hand at finding the centroid of many 2D shapes, as well as of a set of points. In just a few clicks and several numbers inputted, you can find the centroid of a rectangle, triangle, trapezoid, kite, or any other shape imaginable - the only restrictions are that the polygon should be closed, non-self-intersecting, and consist of maximum ten vertices. Also, if you're searching for a simple centroid definition, or formulas explaining how to find the centroid, you won't be disappointed - we have it all.

What is centroid? Centroid definition

Triangle and hexagon balancing on the fingertip. Visual representation of a centroid.

Centroid, also called geometric center, is a center of mass of an object of uniform density. To make it easier to understand, you can imagine it as the point on which you should position the tip of a pin to have your geometric figure balance on it.

How to find centroid? Centroid formula

In general, a centroid is the arithmetic mean of all the points in the shape:

Gx = (x1 + x2 + x3 +... + xk) / k

Gy = (y1 + y2 + y3 +... + yk) / k

For convex shapes, the centroid lays inside the object; for concave ones, the centroid can lay outside (e.g., in a ring-shaped object).

Finding the centroid of a triangle or a set of points is an easy task - formula is really intuitive. However, if you're searching for the centroid of a polygon - like a rectangle, a trapezoid, a rhombus, a parallelogram, an irregular quadrilateral, or another polygon- it is unfortunately a bit more complicated.

Centroid of a triangle

In a triangle, the centroid is the point at which all three medians intersect. That means it's one of a triangle's points of concurrency. Also, a centroid divides each median in a 2:1 ratio (bigger part is closer to the vertex).

To find the centroid of a triangle ABC you need to find average of vertex coordinates. So if A = (X1,Y1), B = (X2,Y2), C = (X3,Y3), the centroid formula is:

G = [ (X1+X2+X3)/3 , (Y1+Y2+Y3)/3 ]

If you don't want to do it by hand, just use our centroid calculator! :)

Centroid of a triangle in a coordinate system.

For special triangles, you can find the centroid quite easily:

  1. Centroid of an equilateral triangle

    If you know the side length, a, you can find the centroid of an equilateral triangle:

    G = (a/2, a√3/6)

  2. Centroid of an isosceles triangle

    If your isosceles triangle has legs of length l and height h, then the centroid is described as:

    G = (l/2, h/3)

  3. Centroid of a right triangle

    For a right triangle, if you're given the two legs b and h, you can find the right centroid formula straight away:

    G = (b/3, h/3)

Sometimes people wonder what the midpoint of a triangle is - but hey, there's no such thing! The midpoint is a term tied to a line segment. It's the middle point of a line segment, and therefore does not apply to 2D shapes. However, you can say that the midpoint of a segment is both the centroid of the segment and the centroid of the segment's endpoints. You can check it in this centroid calculator: choose N-points option from the drop-down list, enter 2 points, and input some random coordinates. The result should be equal to the outcome from the midpoint calculator. (Keep in mind that calculations won't work if you use the second option, the N-sided polygon. Why? That's because that formula uses the shape area, and a line segment doesn't have one).

Centroid of a set of points

To find the centroid of a set of k points, you need to calculate the average of their coordinates:

Gx = (x1 + x2 + x3 +... + xk) / k

Gy = (y1 + y2 + y3 +... + yk) / k

And that's it! Did you notice that it's the general formula we presented before?

Four points in the coordinate system, with coordinates and centroid marked.

Calculating the centroid of a set of points is used in many different real-life applications, e.g. in data analysis. The most popular method is K-means clustering, where an algorithm tries to minimise the squared distance between the data points and the cluster's centroids.

Centroid of a polygon (centroid of a trapezoid, centroid of a rectangle and others)

To calculate a polygon's centroid, G(Cx,Cy), which is defined by its n vertices (x0,y0),(x1,y1),...(xn-1,yn-1), all you need to do is to use these following three formulas:

Where A is a polygon's signed area:

Remember that the vertices should be inputted in order and the polygon should be closed - meaning that the vertex (x0,y0) is the same as the vertex (xn,yn).

If that centroid formula scares you a bit, wait no further - use this centroid calculator, as we've implemented that equation for you.

Trapezoid in the coordinate system, with vertices and centroid marked.

Even though you can find many different formulas for a centroid of a trapezoid on the Internet, the equations presented above are universal - you don't need to have the origin coinciding with one vertex, nor the trapezoid base in line with the x-axis. Here, by knowing just the vertices, you can find the centroid position. The same applies to the centroid of a rectangle, rhombus, parallelogram, pentagon, or any other closed, non-self-intersecting polygon.

Centroid calculator

To use this centroid calculator, simply input the vertices of your shape as Cartesian coordinates. Let's check how to find the centroid of a trapezoid:

  1. Choose the type of shape for which you want to calculate the centroid. In our case, we will choose N-sided polygon.
  2. Enter the parameter for N (if required). For our example, we need to input the number of sides of our polygon. As the trapezoid is, of course, the quadrilateral, we type 4 into the N box.
  1. The fields for inputting coordinates will then appear. Enter the coordinates of the vertices of your shape. Let's assume our trapezoid vertices are:
  • A = (1,1)
  • B = (2,4)
  • C = (5,4)
  • D = (11,1)
  1. Our centroid calculator will then displays the answer! The centroid of the trapezoid of our choice is (4.974,2.231).
Hanna Pamuła, PhD candidate

Get the widget!

Centroid Calculator can be embedded on your website to enrich the content you wrote and make it easier for your visitors to understand your message.

It is free, awesome and will keep people coming back!

Centroid Calculator. Centroid of a triangle, trapezoid, rectangle