Calculates the centroid for a given set of XYZ coordinates.

centroid(data)

Arguments

data

A data frame with x, y, and z coordinates.

Value

The coordinates of the centroid.

Examples

data <- mesh_to_points(mcap)
centroid(data)
#> [1] -1.2530338  0.9478938 -3.6076058