- Home /

# Find centermost vector3? Edges?

Given a `List<Vector3>`

how can I find the center most vector(s)?

It would also be useful to be able to find the edge vectors.

My lists represent a flat grid (same Y axis all points) and is square.

Thank you

**Answer** by elenzil
·
4 hours ago

```
"centermost" could mean a few things.
if you're thinking of something like a center of mass, then two steps:
1) compute the center of mass by adding up all the points and dividing by the number of points.
2) iterate through your points and find the one/s closest to the center of mass.
if you're thinking of the points closest to the geometrical center of the square,
you'd probably be fine with these steps:
1) iterate through the points tracking the minimum and maximum X and Z values.
2) call the 'center' just (min + max) / 2 for X and Z.
3) iterate again finding the point/s closest to that center.
```

Converted into an answer because that's essentially the same I would have answered ^^.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.