# Center of model Coordinates

I am trying to find the center of a set of X, Y, Z coordinates in a given ASCII file. The file is formated like:

``````node_# X_coord Y_coord Z_coord
1    0.0023   2.32   1.34
2    3.21     9.23   3.21
...
``````

The actual structure of the ASCII file could have the nodes/points in any arbitrary order. I thought about getting the max and min of the file and taking the mid-point but since the nodes could zig-zag around in placement, if I used the standard distance formula I might not get the actual maximum and minimum node/point.

I am a little “rusty” on geometry, so any help would be greatly appreciated.

Thanks.

I thought about getting the max and min of the file and taking the mid-point but since the nodes could zig-zag around in placement, if I used the standard distance formula I might not get the actual maximum and minimum node/point.
This part of your post is very unclear.
If you use min/max then you get bounding box of entire object and mid-point would be the center of all coordinates.
I don’t know why do you think random order has anything to do here.
I also don’t understand what kind of distance function are you referring to. If you use min-max and then just take mid-point then there is no single operation in such algorithm that would require any distance function.