User Rating 0.0
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

About

The centroid of a triangle is the point where its three medians intersect. A median connects a vertex to the midpoint of the opposing side. This intersection point, denoted G, always lies inside the triangle and divides each median in a 2:1 ratio measured from the vertex. In physics, the centroid corresponds to the center of mass of a uniform triangular lamina. If you place a physical triangle cutout on a pin at G, it balances perfectly. Errors in centroid computation propagate directly into structural load calculations, CNC machining offsets, and finite element mesh generation.

This calculator accepts three vertex coordinates (x1, y1), (x2, y2), (x3, y3) in the Cartesian plane. It returns the exact centroid coordinates, all three median lengths, side lengths, and the triangle area via the Shoelace formula. The tool rejects degenerate (collinear) inputs where area equals 0. Results assume a Euclidean plane with no curvature correction.

centroid triangle geometry median coordinates barycenter center of mass

Formulas

The centroid G of a triangle with vertices (x1, y1), (x2, y2), (x3, y3) is computed as the arithmetic mean of the vertex coordinates:

G = (x1 + x2 + x33, y1 + y2 + y33)

The area of the triangle is obtained via the Shoelace (Surveyor's) formula:

A = 12 |x1(y2 y3) + x2(y3 y1) + x3(y1 y2)|

Each median length from vertex A to the midpoint of side a (opposite) is:

ma = 122b2 + 2c2 a2

Where x1, y1, x2, y2, x3, y3 are the Cartesian coordinates of the three vertices. A is the signed area (absolute value taken). a, b, c are the side lengths opposite to vertices A, B, C respectively. ma is the median from vertex A to the midpoint of side a. The centroid G divides each median in a 2:1 ratio from vertex to opposite midpoint.

Reference Data

Triangle TypeCentroid PositionMedian PropertyArea Condition
EquilateralCoincides with circumcenter, incenter, orthocenterAll 3 medians equal lengthA = 34 a2
IsoscelesLies on axis of symmetry2 medians equalA = b44a2 b2
ScaleneNo special alignment with other centersAll 3 medians differUse Shoelace or Heron's formula
Right Triangle13 from hypotenuse midpoint to right-angle vertexMedian to hypotenuse = half hypotenuseA = 12ab
ObtuseCloser to the obtuse vertexLongest median from smallest angle vertexStandard formulas apply
AcuteRoughly centeredAll medians inside triangleStandard formulas apply
Degenerate (collinear)Undefined (no triangle)No medians existA = 0
Very Narrow (near-degenerate)Near the longest sideOne median very shortA 0
Center TypeDefinitionAlways Inside?Coordinate Formula
Centroid (G)Median intersectionYes(x1+x2+x33, y1+y2+y33)
Circumcenter (O)Perpendicular bisector intersectionNo (outside for obtuse)Requires solving linear system
Incenter (I)Angle bisector intersectionYesWeighted by side lengths
Orthocenter (H)Altitude intersectionNo (outside for obtuse)Requires altitude equations
Nine-Point Center (N)Midpoint of O and HYes (for acute)Average of O and H
PropertyValue / Rule
Centroid divides each median2:1 ratio (vertex to midpoint)
Euler LineG lies on segment OH, with OG:GH = 1:2
Median length formulama = 122b2 + 2c2 a2
Sum of squared medians34(a2 + b2 + c2)
Centroid minimizesSum of squared distances to vertices
Barycentric coordinates of G(1:1:1)

Frequently Asked Questions

The centroid is defined as the arithmetic mean of all three vertices. Since the mean of any convex combination of interior points remains interior, the point G = ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3) is always a convex combination with equal weights of 1/3. Convex combinations of vertices of a convex polygon always fall inside it. This holds for acute, obtuse, right, scalene, isosceles, and equilateral triangles without exception.
In engineering, when a uniform triangular plate must be supported at a single point, that point must be the centroid. The 2:1 ratio means the centroid sits one-third of the median's length from the midpoint of the opposite side, or two-thirds from the vertex. Placing the support elsewhere creates a net torque. For a triangular truss with vertex loads of equal magnitude, the reaction force passes through G. Misidentifying G by even a few millimeters on large structures introduces bending moments that exceed safety factors.
When all three points lie on the same line, the Shoelace formula yields A = 0. The shape is a degenerate triangle - a line segment, not a polygon. While the arithmetic mean of the coordinates still produces a point, it has no geometric meaning as a centroid of a 2D region. This calculator detects collinearity by checking if |A| < 1×10⁻¹⁰ and rejects such inputs. In practice, near-collinear triangles (very small area) produce numerically unstable centroid positions in downstream FEM calculations.
For an equilateral triangle, the centroid, circumcenter, incenter, and orthocenter all coincide at the same point. For an isosceles triangle, the centroid lies on the axis of symmetry but does not generally coincide with other centers. For scalene triangles, all four centers are distinct. The centroid always lies on the Euler line, which also passes through the circumcenter O and orthocenter H, with the ratio OG:GH = 1:2.
Yes. The centroid formula is purely algebraic and works identically for negative, zero, or positive coordinates in all four quadrants of the Cartesian plane. JavaScript's IEEE 754 double-precision floating point supports values up to approximately ±1.8×10³⁰⁸ with about 15-17 significant digits. For coordinates beyond ±10⁹, floating-point rounding may introduce errors in the last few decimal places. The calculator displays results to 4 decimal places, which is sufficient for most engineering and academic applications.
The Shoelace formula used here is equivalent to half the magnitude of the cross product of two edge vectors. If you define vectors u = (x₂−x₁, y₂−y₁) and v = (x₃−x₁, y₃−y₁), then A = ½|u × v| = ½|u_x·v_y − u_y·v_x|. This is the standard approach in computational geometry. The sign of the cross product also indicates vertex winding order: positive for counterclockwise, negative for clockwise.