The centroid is the geometric mean of the vertices in a geometry. euclid supports centroid calculations for triangles, tetrahedrons and 2-4 points

centroid(x, y = NULL, z = NULL, t = NULL)

x | A vector of triangles or tetrahedrons, or points if |
---|---|

y, z, t | Vector of points |

a vector of points

p <- point(c(1, 5, 6), c(1, -2, 4)) # centroid of triangle t <- triangle(p[1], p[2], p[3]) centroid(t)#> <2D points [1]> #> [1] <x:4, y:1># Same as providing the points directly centroid(p[1], p[2], p[3])#> <2D points [1]> #> [1] <x:4, y:1>