Which is the center between 4 points mathematically speaking

I’m trying to center the camera between 4 points (it’s a diablo-like camera), however I don’t understand which is the “center” between 4 points mathematically speaking.

I thought some algorithms but none of them satisfacted me.

Which is the correct way to calculate this?

“Center” means what you want it to mean. My first thought would be to average them (multiply each by .25 and add the results), but if that’s not what it means to you, program what it means to you.

I still think finding the bounds of the four is what you need (acually, it would work for any number)

Just loop through all the positions, find the minimum and maximum X, Y, & Z of the whole set.

These coordinates will describe a cuboid volume.

The center of that is the point you want, I believe.
You’d find that center by XMax + XMin /2, repeat for Y & Z.

Two points of middle :

 var firstPoint : Vector3;
 var secondPoint : Vector3;

 Vector3 center= (firstPoint + secondPoint)/2 ; 

Four point of middle must be same way to calculate :

 center = (firstPoint + secondPoint + thirdPoint + fourthPoint )/4;

mathematically speaking, p1 + p2 + p3 + p4 / x, where x is the number of points, p (p1, p2, p3, p4) are the pitches of each point, so you have to calculate the X,Y and Z, The calculations are

X1 + X2 + X3 + X4/4 = XCenter Y1+Y2+Y3+Y4/4 = YCenter Z1+Z2+Z3+Z4/4 = ZCenter

but you said about diablo camera, so i think that the Y you will use always the same.