Let's say I have a cloud of points, defined by 3 coordinates(x, y, z). It could work in any number of dimensions, I imagine. I want to find such a point(arbitrary, does not have to be in the cloud), that the average Euclidean distance from it to points in the cloud.Basically, it would be like finding a good spot in the city for a firefighting station, given that we know coordinates of houses that can catch fire and want to minimize our reaction time.
I wrote this function, but not sure if it makes sense.
def centrum(cloud):
size=len(cloud)
#generalize to n dimensions
xc=0
yc=0
zc=0
for point in cloud:
xc=xc+point.x
yc=yc+point.y
zc=zc+point.z
return Point(xc/size, yc/size, zc/size)